D
DR
I'm calling Marshal.ReleaseComObject but com objects are still leaking. How
to properly release MODI.Document??
private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < 1000000; i++)
{
MODI.Document miDoc = new MODI.Document();
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);
System.Runtime.InteropServices.Marshal.ReleaseComObject(tifImg);
System.Runtime.InteropServices.Marshal.ReleaseComObject(miDoc);
}
}
to properly release MODI.Document??
private void Form1_Load(object sender, EventArgs e)
{
for (int i = 0; i < 1000000; i++)
{
MODI.Document miDoc = new MODI.Document();
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);
System.Runtime.InteropServices.Marshal.ReleaseComObject(tifImg);
System.Runtime.InteropServices.Marshal.ReleaseComObject(miDoc);
}
}