Thanks! Let me know if your tests bring something up, otherwise I'll make a repro.
Romain is right, the runtime doesn't keep track of events and edts. There's no automatic cleanup for any data structure associated with them.
It's the responsibility of the user/generated code to cleanup events and edts using the ocr api: ocrEventDestroy, ocrEdtDestroy (I'm not 100% sure what's the rule for DBs). init/cleanup just build "infrastructure" data-structures such as workers, queues etc… It could be that something is not correctly init/cleanup, leaving corrupted pointers somewhere.
Benoit, if you have a simple example I can play with, I'll be glad to have a look to understand where the segfault occurs.
I'll also write some simple tests calling init/cleanup in sequence see if I can get it to fail.
On Jan 10, 2013, at 9:41 AM, "Cledat, Romain E" <email@example.com> wrote:
> This may be a bug so please file a bug report with a test case (btw, you mentioned you can’t add attachments to bug reports, is this correct? Rob, can we fix this?).
> The idea behind ocrInit and ocrCleanup is indeed to create and destroy the OCR environment so they should, in theory, be able to be called multiple times as long as they are properly paired and not nested.
> I’ll let Vincent answer on whether or not ocrCleanup will try to cleanup events/DBs that have already been cleaned up but I do not think so so I think the problem may be elsewhere.
> From: firstname.lastname@example.org [mailto:email@example.com] On Behalf Of Benoit Meister
> Sent: Wednesday, January 09, 2013 4:30 PM
> To: Technical discussion about OCR
> Subject: [OCR-dev] What does ocrCleanup clean up ?
> Hi again,
> I have a function that calls ocrInit and ocrCleanup and this function gets called several times.
> I'm cleaning up all sorts of things at each call, including events (since they're sticky), DBs, etc.
> But I don't know if I should do that or if I'm conflicting with ocrCleanup.
> I get segfaults at the second call of the function, when it first calls ocrEdtCreate, which is why I'm suspecting an interference problem.
> - Benoit
> OCR-dev mailing list
OCR-dev mailing list