I considered moving the disposal to Window.Clear(), but this necessarily isn't called. Like Window.DispatchEvents() is.
Merged ObjectBase and ObjectBaseSafeHandle since last pull request.
Moves garbage disposal to main thread and ensures it via SafeHandles.…
… See http://en.sfml-dev.org/forums/index.php?topic=12248.30
Merged ObjectBase and ObjectBaseSafeHandle
Fixed ArgumentException thrown for some ObjectBase subclass constructors
Fixed compile break
I have been looking into the memory leak issue, and fixing it does not require what you have done. The problem actually lies within the context management of SFML, however I am still working on tracking down what exactly causes the issue. Sometimes memory leaks, other times not.
What should we do with this PR?
I am closing this, the issue has already been shown to be related to either stuff happening in multiple threads or not explicitly calling Dispose() when finished with objects (GC doesn't know how much unmanged memory we allocate #5). All this PR does is move the automatic GC to the main thread so it doesn't leak contexts.
I have had 3rd party confirmation that the current library as-is is stable and does not leak memory. Stress testing has been done by @rcurtis over the course of many days and there is no memory leaks.