It is helpful to
understand a few things about memory when we use the AutoCAD .NET API. The
managed Objects in the .NET API are wrapped by unmanaged C++ objects. When we
use the New keyword to create a new object you do not need to dispose of them
because of the .NET garbage collection behaviour. If the object is disposed
and it is not in the database the underlying unmanaged object is deleted. If
the object is database resident the underlying unmanaged object is closed. If
we use a transaction, which we will do most of the time, disposing or
committing the transaction closes the unmanaged object. Now let’s put these
ideas we covered in this presentation about the AutoCAD drawing database,
ObjectId’s and transactions to work by going through lab three. |