Dear All,
Please help me to sort one of my doubts regarding Release of Un-Managed Objects. If we are not explicitly calling dispose/close method for un-managed objects neither we are implementing finalizer for this unmanaged objects then what will happened for this unmanaged objects. Whether Operating system will take care after some time to release it or it will stay there till Operating system shouldn't get restarted. Please share your views regarding it.
Regards,
Ashish Khandelwal
Loading
Sam HobbsPosted Sep 18, 2011, 1:00 AM
The C++ compiler and most C++ programmers consider memory leaks to be a serious problem. Certainly it is unlikely that there will be any memory leaks after your application finishes but most C++ programmers would consider it to be sloppy to depend on that. It is a real problem for long-running programs and programs that make extensive use of resources that do not get freed.
C# and the .Net libraries are designed to use garbage collection and make memory use easy. Unfortunately that is a problem for unmanaged code and for that C# can be confusing and frustrating.
It is not a matter of our views; it is a matter of what the truth is. The truth is that there are no easy answers. You must spend time learning the subject if you need to develop software such as what you are asking about.
VulpesPosted Sep 17, 2011, 6:51 AM