Android- fix a crash when the game view is closed before it started running
authorTzach Shabtay <tzachshabtay@gmail.com>
Sun, 11 Dec 2016 22:50:38 +0000 (17:50 -0500)
committerTzach Shabtay <tzachshabtay@gmail.com>
Sun, 11 Dec 2016 22:50:38 +0000 (17:50 -0500)
When the game view is closed, if it hasn’t started running yet the
stopwatch would still be null- added a null check.

src/OpenTK/Platform/Android/AndroidGameView.cs

index cb438b6..6d6d01e 100644 (file)
@@ -457,7 +457,7 @@ namespace OpenTK.Platform.Android
 
             // if the render thread is paused, let it run so it exits
             pauseSignal.Set ();
-            stopWatch.Stop ();
+            if (stopWatch != null) stopWatch.Stop ();
         }
 
         void PauseThread ()