Desktop ArcObjects - Dispose VB.NET forms upon ArcMap close

617
3
08-06-2010 07:26 AM
tonydavid
New Contributor III
Hi there, the custom application (compile as DLL) has multiple forms open and close. When the forms are open and we close ArcMap ... it gives memory leak errors.

Some forums mention using IDllThreadManager? Theres a IDllThreadManager.OnShutdown method - terminate any threads that were created by the components in dll.

Also there's some that suggest it could be COM objects are not released after the VB forms are disposed - http://resources.esri.com/help/9.3/arcgisdesktop/dotnet/ESRI.ArcGIS.ADF/apiref_01/ESRI.ArcGIS.ADF.CO...

Anyone has ideas how to solve this? Any help or sample code is much appreciate. Thanks.
0 Kudos
3 Replies
vincentLahaye
New Contributor II
what's your error message.

not easy to find your error like this.

i bet on a bad com release, but where?

vincent
0 Kudos
tonydavid
New Contributor III
OK. Sorry forgot to mention where it happens ...

Only happens when customised form is left open / modal and click close armap.

The DLL implements IExtension Shutdown. Error in code where loop all the open forms and close. This Error is the usual fatal error (send message to ESRI dialog box) and ArcMap crashes.
0 Kudos
vincentLahaye
New Contributor II
How is it possible to close ArcMap when your form is modal.  I think your forms are non-modal.  Maybe it's a solution for your extension.  Put your form as modal. With this, users must close this form before close ArcMap.

But I think it's not what you want,  it's just another way.

Maybe you have a connection problem in your forms. which kind of connection you have in your forms (Oracle, PGDB, FGDB others..).  That could be another problem.
0 Kudos