Occurs second time I read some barcode types like Code39Standard. For example DataMatrix it does not happen - I can read it again and again.
Only thing that looks out of place is the PrepareForUnload that I call for each image I look for barcodes on…
std::list<BarcodeHelper::Barcode> BarcodeHelper::barcodes(const unsigned char* filedata, const size_t filesize, const std::wstring& barcodetype)
{
System::IO::MemoryStream::Ptr stream = System::MakeObjectSystem::IO::MemoryStream();
// TODO: is this really the best way of getting data into Aspose?
for (size_t i = 0; i < filesize; i++)
stream->WriteByte(*(filedata + i));
stream->set_Position(0);
std::list<Barcode> result;
System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>(stream, DecodeType::Code39Standard);
while (reader->Read() == true)
{
}
System::AsposeCppLibrary::PrepareForUnload(); // probably not the optimal place, but it is required before shutting down application, after reader->Read() has been called once
return result;
}