Dispose a DXF Document #296
-
How can I "Dispose" an readed file? when I use very large files, I need to discard documents already read and then read another one. How can I do this? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I called the GC.Collect(2) method after normally dropping the file (=null), and the class 2 collection performed the cleanup successfully. For some reason the collector did not detect the need to delete the data without the manual call, even after a long time. |
Beta Was this translation helpful? Give feedback.
-
There is no need for the DxfDocument class to implement the IDisposable interface. It is only required for types that need to release unmanaged resources, and this is not the case. The Net's garbage collector takes care of the allocation and release of memory for your application. If you need more detail information about how and when the net garbage collector does its things, you will have better luck somewhere else, somewhere more dedicated to the inner workings of the net framework. This is outside of the scope of this library and my knowledge of this matter is limited. |
Beta Was this translation helpful? Give feedback.
There is no need for the DxfDocument class to implement the IDisposable interface. It is only required for types that need to release unmanaged resources, and this is not the case. The Net's garbage collector takes care of the allocation and release of memory for your application.
If you need more detail information about how and when the net garbage collector does its things, you will have better luck somewhere else, somewhere more dedicated to the inner workings of the net framework. This is outside of the scope of this library and my knowledge of this matter is limited.