.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2 REPLIES 2
Reply
Message 1 of 3
wesbird
2862 Views, 2 Replies

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

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
Windows 10 64 bit, AutoCAD (ACA, Map) 2023
2 REPLIES 2
Message 2 of 3
Khalique
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
Message 3 of 3
paranojik
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,...

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost