Merge branch 'master' into import-gui
[pspp] / src / ui / gui / text-data-import-dialog.c
index fe08caa9b115a4a8f039415ca41af9cbb60d2970..597f65127ebdf35fcfff11ab7794573e5e6d438f 100644 (file)
@@ -97,7 +97,6 @@ text_data_import_assistant (PsppireDataWindow *dw)
       ia->intro = intro_page_create (ia);
       ia->separators = separators_page_create (ia);
       ia->first_line = first_line_page_create (ia);
-
       printf ("%s:%d %p\n", __FILE__, __LINE__, ia->intro);
     }
   ia->formats = formats_page_create (ia);
@@ -105,7 +104,20 @@ text_data_import_assistant (PsppireDataWindow *dw)
   gtk_widget_show_all (GTK_WIDGET (ia->asst.assistant));
 
   ia->asst.main_loop = g_main_loop_new (NULL, false);
-  g_main_loop_run (ia->asst.main_loop);
+
+  {  
+  /*
+    Instead of this block,
+    A simple     g_main_loop_run (ia->asst.main_loop);  should work here.  But it seems to crash.
+    I have no idea why.
+  */
+    GMainContext *ctx = g_main_loop_get_context (ia->asst.main_loop);
+    ia->asst.loop_done = false;
+    while (! ia->asst.loop_done)
+      {
+       g_main_context_iteration (ctx, TRUE);
+      }
+  }
   g_main_loop_unref (ia->asst.main_loop);
 
   switch (ia->asst.response)