From add773c88cdb2e77b3337c5db2d42b4c02f34c08 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Mon, 26 Jun 2006 15:49:07 +0000 Subject: [PATCH] Fix a possible segfault on quitting caused by processing GTK messages before status messages git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@487 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 6 ++++++ src/document.c | 19 +++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index a42927be..a5874f0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-06-26 Nick Treleaven + + * src/document.c: Fix a possible segfault on quitting caused by + processing GTK messages before status messages. + + 2006-06-25 Enrico Troeger * README, doc/geany.docbook: Added license notice Scintilla. diff --git a/src/document.c b/src/document.c index 9ec5dbea..0db5a089 100644 --- a/src/document.c +++ b/src/document.c @@ -525,16 +525,6 @@ int document_open_file(gint idx, const gchar *filename, gint pos, gboolean reado utils_build_show_hide(idx); } - // update sci to send SCN_UPDATEUI before we set status messages - while (gtk_events_pending()) - gtk_main_iteration(); - if (reload) - msgwin_status_add(_("File %s reloaded."), utf8_filename); - else - msgwin_status_add(_("File %s opened(%d%s)."), - utf8_filename, gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)), - (readonly) ? _(", read-only") : ""); - document_set_text_changed(idx); g_free(data); @@ -552,6 +542,15 @@ int document_open_file(gint idx, const gchar *filename, gint pos, gboolean reado utils_update_recent_menu(); } + // currently status messages are overridden by update sci SCN_UPDATEUI message + // processing gtk messages first causes a segfault on closing & reloading utils.c + if (reload) + msgwin_status_add(_("File %s reloaded."), utf8_filename); + else + msgwin_status_add(_("File %s opened(%d%s)."), + utf8_filename, gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)), + (readonly) ? _(", read-only") : ""); + g_free(utf8_filename); g_free(locale_filename); //gettimeofday(&tv1, &tz);