static void on_close (GtkAssistant *assistant, struct import_assistant *);
static void on_paste (GtkButton *button, struct import_assistant *);
static void on_reset (GtkButton *button, struct import_assistant *);
-static void close_assistant (struct import_assistant *, int response);
/* Initializes IA's asst substructure. PARENT_WINDOW must be the
window to use as the assistant window's parent. */
close_assistant (struct import_assistant *ia, int response)
{
ia->asst.response = response;
- g_main_loop_quit (ia->asst.main_loop);
+ /* Use our loop_done variable until we find out
+ why g_main_loop_quit (ia->asst.main_loop); doesn't work.
+ */
+ ia->asst.loop_done = true;
gtk_widget_hide (GTK_WIDGET (ia->asst.assistant));
}
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)