WP7: properly disposing resources

Jan 21, 2011 at 9:28 AM

A simple question: is there a best practice to dispose Balder's resources on WP7?

In particular: I have a page with a Balder scene, when I navigate away from that page should I do something or the engine does everything to prevent unneeded resource usage? I've tried setting IsPaused=true and the IsPaused=false but this seems to cause several issues and is probably not the good way anyways.

Also on shutdown of the application, is it necessary to do something to "stop" the engine?



Jan 23, 2011 at 10:10 AM

In theory it should be able to dispose everything itself. 

There are a couple of things it won't be disposing at the moment, and there is a lack in the API for doing it as well. One of them are assets. There is an internal caching mechanism for all assets loaded with Balder. These are at the moment not getting cleaned out even there are no references to them. 

There will become a reference counting solution for these that will ensure that they are garbage collected.

Also, there has been reports of a couple of memory leakage situations - something that is also under way in being dealt with.