0

Hi,

I am creating an object of AxShockwaveFlash

private AxShockwaveFlash flash;
void init()
{
  this.flash= new AxShockwaveFlashObjects.AxShockwaveFlash();
}

and releasing it in

protected override void Dispose(bool disposing)
        {
            if (_flash!= null)
                _flash.Dispose();
}

but when i am using .Net Memory Profiler i am getting following message

"The instance has been disposed but still has not been GCed."

I am not able to get any solution for this .Why it is not GCed and why it is giving me a memory leak? while i am using Dispose().

Regards

ShaBeg

Edited by shabeg: n/a

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by jonsca
0

Check out this great article: http://ondotnet.com/pub/a/dotnet/2002/02/11/csharp_traps.html

in the article: "...because finalization is nondeterministic (meaning you can’t control when the garbage collector will run)..."

Dispose() can be used for any and all cleanup required but the garbage collector will gather the object and call it's destructor (thus finalizing the job).

I would say unless you are noticing via a profiler that the memory is not reclaimed it's probably getting GC'd later.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.