2007-08-30, 12:06 AM
Hey, I added the following code:
And it does help, but there's still some leakage...
I have tested again with the original, unaltered WeatherPlugin sample, and it seems to be there as well.... Seems like something in the framework isn't releasing some objects....
When I run the original sample, and I press the "Add" button / Esc about 20-30 times, I see memory consumption go up, but never being entirely released....
Could be something in the framework?? I added the following logging-code before initializing and after disposing the popup, and all indications are that there's memory not being freed somewhere...
I'll get on with building some more functionality and wait till you get back from your trip to learn more...
Regards,
Code:
public override void Dispose()
{
ArrayList DisposeList = new ArrayList();
DisposeList.Add(theImage);
PluginHelperFactory.getPluginHelper().DisposeResources(DisposeList);
SkinHelper2.disableAnimation();
skinHelper2.DisposeResources();
base.Dispose();
}
And it does help, but there's still some leakage...
I have tested again with the original, unaltered WeatherPlugin sample, and it seems to be there as well.... Seems like something in the framework isn't releasing some objects....
When I run the original sample, and I press the "Add" button / Esc about 20-30 times, I see memory consumption go up, but never being entirely released....
Could be something in the framework?? I added the following logging-code before initializing and after disposing the popup, and all indications are that there's memory not being freed somewhere...
Code:
case "Add":
// do something...
GC.Collect();
GC.WaitForPendingFinalizers();
Logger.Verbose("In use (Pre): " + GC.GetTotalMemory(false));
setPopup(new AddCityPopup(this));
return;
Code:
// close popup
AddCityPopup r = (AddCityPopup)popup;
setPopup(null);
r.Dispose();
r = null;
popup = null;
GC.Collect();
GC.WaitForPendingFinalizers();
Logger.Verbose("In use (Post): " + GC.GetTotalMemory(false));
I'll get on with building some more functionality and wait till you get back from your trip to learn more...
Regards,
//Ton