TheSwamp

Code Red => .NET => Topic started by: waterharbin on October 12, 2011, 02:39:33 AM

Title: Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Line): DisposableWrap
Post by: waterharbin on October 12, 2011, 02:39:33 AM
Hello.I found something uncomfortable.If I just type this code
Code: [Select]
Line aidLine = new Line(new point3d(0,0,0),new point3d(10,10,10));
After debug, the output window shows "Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Line): DisposableWrapper". I don't konw what's this.
I don't want my aidLine to be visible. This line just an auxiliary line in the middle of a process.How to get rid of this info?
Title: Re: Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Line): DisposableWrap
Post by: kaefer on October 12, 2011, 03:11:41 AM
After debug, the output window shows "Forgot to call Dispose?

If you don't add the Line to your Transaction you are responsible to release the resources used by it. That's why this message is very helpful. Just do what it said, or better yet, wrap your temporary graphical object in a using statement.