garbage collection - Managed and Unmanaged resources in .Net -
i confused between managed , unmanaged resources in .net programming. developing vb.net application. read in microsoft website that, if use managed resources garbage collector dispose , if use unmanaged resources need call dispose. didn’t answer following questions anywhere.
- how can differentiate resources used code “managed” , “unmanaged”? can have list of resources belonging managed , unmanaged resources?
- whether resources used/allocated before creation of objects or after creation of objects?
- in case of unmanaged resources whether resources disposed once scope gets closed or should dispose after closing of scope?
- if class inherits
idisposable
unmanaged or contains unmanaged - not sure mean, @ ctor, creation of object, cant before, consider ctor after? (o.c. unless stated otherwise)
- best practice inheriting
idisposable
anywhere use managed code, .net having gc unless somehow lock unmanaged res. should ok.
Comments
Post a Comment