Merge remote-tracking branch 'origin/master' into sheet
authorJohn Darrington <john@darrington.wattle.id.au>
Fri, 12 Aug 2016 16:40:23 +0000 (18:40 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Fri, 12 Aug 2016 16:40:23 +0000 (18:40 +0200)
src/ui/gui/main.c
src/ui/gui/psppire-dict.c

index 2d90ce8fd257648527c26850d1809e8a9b1c6a4c..4716b1fa4da6af353e060fa6b22423dc5ae6a11b 100644 (file)
@@ -94,7 +94,7 @@ static GSourceFuncs init_funcs =
 \f
 
 
-GtkWidget *wsplash;
+GtkWidget *wsplash = 0;
 gint64 start_time = 0;
 
 
@@ -202,6 +202,7 @@ destroy_splash (gpointer ud)
 {
   GtkWidget *sp = GTK_WIDGET (ud);
   gtk_widget_destroy (sp);
+  wsplash = NULL;
   return G_SOURCE_REMOVE;
 }
 
@@ -211,18 +212,21 @@ on_activate (GApplication * app, gpointer ud)
   post_initialise (app);
 
   GtkWindow *x = create_data_window ();
-  gtk_window_set_transient_for (GTK_WINDOW (wsplash), GTK_WINDOW (x));
-  gtk_application_add_window (GTK_APPLICATION (app), x);
-  gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (wsplash));
-  gtk_window_set_keep_above (GTK_WINDOW (wsplash), TRUE);
-  gtk_window_present (GTK_WINDOW (wsplash));
-
-  /* Remove the splash screen after SPLASH_DURATION milliseconds */
-  gint64 elapsed_time = (g_get_monotonic_time () - start_time) / 1000;
-  if (SPLASH_DURATION - elapsed_time <= 0)
-    destroy_splash (wsplash);
-  else
-    g_timeout_add (SPLASH_DURATION - elapsed_time, destroy_splash, wsplash);
+  if (wsplash)
+    {
+      gtk_window_set_transient_for (GTK_WINDOW (wsplash), GTK_WINDOW (x));
+      gtk_application_add_window (GTK_APPLICATION (app), x);
+      gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (wsplash));
+      gtk_window_set_keep_above (GTK_WINDOW (wsplash), TRUE);
+      gtk_window_present (GTK_WINDOW (wsplash));
+
+      /* Remove the splash screen after SPLASH_DURATION milliseconds */
+      gint64 elapsed_time = (g_get_monotonic_time () - start_time) / 1000;
+      if (SPLASH_DURATION - elapsed_time <= 0)
+       destroy_splash (wsplash);
+      else
+       g_timeout_add (SPLASH_DURATION - elapsed_time, destroy_splash, wsplash);
+    }
 }
 
 
index 53ba83aa1d62aaa1909a5aea246197c9a424cb2e..0a0c3ae0b4f1884b32803e905fd4781207607833 100644 (file)
@@ -769,11 +769,11 @@ tree_model_iter_next (GtkTreeModel *model, GtkTreeIter *iter)
   struct variable *var;
   gint idx;
 
-  g_return_val_if_fail (iter->stamp == dict->stamp, FALSE);
-
   if ( iter == NULL || iter->user_data == NULL)
     return FALSE;
 
+  g_return_val_if_fail (iter->stamp == dict->stamp, FALSE);
+
   var = iter->user_data;
 
   idx = var_get_dict_index (var);