.NET

.NET

Reply
Distinguished Contributor
wesbird
Posts: 351
Registered: ‎12-05-2003
Message 1 of 3 (490 Views)

Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Polyline): Disposable

490 Views, 2 Replies
12-06-2005 08:15 AM
Hi,
I have C# autocad application, when I finish my debug in AutoCAD, I found this error message in Visual Studio Output window under Debug:
Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Polyline): DisposableWrapper

Has anybody meet this before? What this mean? How should I handle it: Is it OK to ignore it or What I can do to get rid of it?

Because there are a lot of code in my application and I have no idea where could be the problem. So I have no way to post the code here.

Thank you
Merry Christmas

Wes
Contributor
Khalique
Posts: 14
Registered: ‎11-14-2005
Message 2 of 3 (490 Views)

Re: Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Polyline): Disposable

12-08-2005 06:28 AM in reply to: wesbird
Most likely cause is that you declared a variable representing a COM Object and instantiated it. After using it, you did not dispose it off. C# is telling you that it doesn't know how to free the memory occupied by this object. Repeated object creation without proper disposal in this case will make available memory less and less until you reboot you machine.
Look for the the object type in your code that is mentioned in the error message. That object may have a method to dispose itself like Object.Quit() or similar.
I am no good with AutoCAD, just a beginner. Therefore I can not tell what object it could be. However, you might tell folks here what version of AutoCAD, AutoCAD .Net Libraries and Visual Studio you are using. That may help in finding a resolution.
kr
New Member
paranojik
Posts: 1
Registered: ‎11-05-2005
Message 3 of 3 (490 Views)

Re: Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Polyline): Disposable

02-10-2006 12:37 AM in reply to: wesbird
Be aware. There is a serious bug with object disposal in the managed wrappers. If you do not properly dispose ALL database objects AutoCAD will eventually CRASH. This has been discussed on the ADN, but so far no solution has been found. The problem also appears in AutoCAD 2007 and as I understand autodesk's answer this problem is not going to be addressed. So, be VERY CAREFUL with operations like Clone(), Explode(), new,...
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.