Author Topic: Forgot to call Dispose? (Autodesk.AutoCAD.DatabaseServices.Line): DisposableWrap  (Read 3827 times)

0 Members and 1 Guest are viewing this topic.

waterharbin

  • Guest
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?

kaefer

  • Guest
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.