Moves garbage disposal to main thread and ensures it via SafeHandles. #33

Closed
wants to merge 4 commits into from

3 participants

@myrup

See http://en.sfml-dev.org/forums/index.php?topic=12248.30

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.

@zsbzsb
Simple and Fast Multimedia Library member

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.

@LaurentGomila
Simple and Fast Multimedia Library member

What should we do with this PR?

@zsbzsb
Simple and Fast Multimedia Library member

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.

@zsbzsb zsbzsb closed this Sep 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment