How to make MODI.Document not leak memory? I have millions of images to OCR but each time i OCR one

  • Thread starter Thread starter DR
  • Start date Start date
D

DR

How to make MODI.Document not leak memory? I have millions of images to OCR
but each time i OCR one it leaks memory. How to do the OCR and then clean up
so that my app doesnt leak memory?

MODI.Document miDoc = new MODI.Document();
for (int i = 0; i < 1000; i++)
{
miDoc.Create("a.gif");
miDoc.OCR(MODI.MiLANGUAGES.miLANG_ENGLISH, true, true);
MODI.Image tifImg = (MODI.Image)miDoc.Images[0];
string recSTring = tifImg.Layout.Text;
miDoc.Images.Remove(tifImg);
miDoc.Close(false);
}
int i23z = 23 + 23;
miDoc.Close(false);
 
Back
Top