File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Source/RunActivity/Viewer3D/Processes Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -131,10 +131,7 @@ internal override void Dispose()
131131 MPManager . Client . Stop ( ) ;
132132 if ( Program . Simulator != null )
133133 Program . Simulator . Stop ( ) ;
134- if ( Program . MapForm != null )
135- Program . MapForm . Dispose ( ) ;
136- if ( Program . SoundDebugForm != null )
137- Program . SoundDebugForm . Dispose ( ) ;
134+ // MapForm and SoundDebugForm run in the Renderer thread and need to be disposed there
138135 base . Dispose ( ) ;
139136 }
140137
Original file line number Diff line number Diff line change @@ -359,6 +359,12 @@ internal void EndDraw()
359359 internal void Stop ( )
360360 {
361361 Game . WatchdogProcess . Unregister ( WatchdogToken ) ;
362+
363+ // these run in the Renderer thread, and thus cannot be disposed in GameStateViewer3D
364+ if ( Program . MapForm != null )
365+ Program . MapForm . Dispose ( ) ;
366+ if ( Program . SoundDebugForm != null )
367+ Program . SoundDebugForm . Dispose ( ) ;
362368 }
363369
364370 static void SwapFrames ( ref RenderFrame frame1 , ref RenderFrame frame2 )
You can’t perform that action at this time.
0 commit comments