[chronojump] safely destroy on splash window



commit 8f1a8a235cffc46918e707a6e23a39ccb1a11041
Author: Xavier de Blas <xaviblas gmail com>
Date:   Wed Nov 19 20:08:08 2014 +0100

    safely destroy on splash window

 src/gui/splash.cs |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/src/gui/splash.cs b/src/gui/splash.cs
index 1a9f1b4..2e17082 100644
--- a/src/gui/splash.cs
+++ b/src/gui/splash.cs
@@ -131,7 +131,17 @@ public class SplashWindow
                        
 
        public void Destroy () {
-               SplashWindowBox.splash_window.Destroy ();
+               //it seem on some machines (MacOSX) splash_window maybe is Destroyed previously because 
on_delete_event it's called
+               //Destroy here if it has not been destroyed
+               if(SplashWindowBox.splash_window == null)
+                       Log.WriteLine("splash_window is null. Do nothing.");
+               else {
+                       Log.WriteLine("splash_window is not null. Destroying now...");
+                       
+                       SplashWindowBox.splash_window.Destroy ();
+                       
+                       Log.WriteLine("Destroyed!");
+               }
        }
 
        private void on_delete_event (object o, DeleteEventArgs args) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]