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

0 Members and 1 Guest are viewing this topic.

闻仲

  • Newt
  • Posts: 84
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?
Need lots of stupid stuffs when you are young, or you will regret it when you are too old to do it.

kaefer

  • Swamp Rat
  • Posts: 562
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.