Skip to content

Commit

Permalink
Merge pull request #994 from peppy/fix-disposal-threading
Browse files Browse the repository at this point in the history
Ensure all threads are stopped before disposing the scene graph
  • Loading branch information
smoogipoo authored Aug 23, 2017
2 parents ed09e76 + fa970c3 commit e2d4182
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions osu.Framework/Platform/GameHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,12 @@ private void setVSyncMode()

protected virtual void Dispose(bool disposing)
{
if (!isDisposed)
{
isDisposed = true;
}
if (isDisposed)
return;

isDisposed = true;
stopAllThreads();
Root?.Dispose();
}

~GameHost()
Expand All @@ -552,8 +554,6 @@ public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);

Root?.Dispose();
}

#endregion
Expand Down

0 comments on commit e2d4182

Please sign in to comment.