Is it compulsary to call Dispose() on custom objects Impementing IDisposable?
hi all
i have inherited code has many custom types/classes implement idisposable interface, during object life-time of these classes dispose method never gets called before object instances fall out of scope. mean resources these objects create/hold not cleaned up?
thanks in advance.
tryst
i have inherited code has many custom types/classes implement idisposable interface, during object life-time of these classes dispose method never gets called before object instances fall out of scope. mean resources these objects create/hold not cleaned up?
thanks in advance.
tryst
yes, gc collect memory , not resources. dispose free resources , gc takes care of memory. finalizers called teh gc , ensure unmanaged resources freed not want rely on because effictively closehandle , nothing more. no commit, no flush, ... performed when finalizers called gc not behaviour want when deal databases.
yours,
alois kraus
yours,
alois kraus
.NET Framework > Common Language Runtime Internals and Architecture
Comments
Post a Comment