Distinguished Contributor
367 Posts
0 Kudos
Registered: ‎12-05-2003
Post 1 of 3

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

551 Views, 2 Replies
12-06-2005 08:15 AM
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

Vault Pro 2014, Windows 7 64 bit, AutoCAD (ACA, Map) 2014
14 Posts
0 Kudos
Registered: ‎11-14-2005
Post 2 of 3

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.
New Member
1 Posts
0 Kudos
Registered: ‎11-05-2005
Post 3 of 3

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,...
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post