[geany/geany] 3cf35f: Fix possible crash on quit

Colomban Wendling git-noreply at xxxxx
Sat Apr 12 14:14:15 UTC 2014


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 12 Apr 2014 14:14:15 UTC
Commit:      3cf35f24c535f46dd549f4636b523ce8e48af5ec
             https://github.com/geany/geany/commit/3cf35f24c535f46dd549f4636b523ce8e48af5ec

Log Message:
-----------
Fix possible crash on quit

When quitting, we still have to destroy the Scintilla widget to avoid
any possibility for us to receive signals from it after we destroyed
the associated editor and/or document (used in signal handlers).

I myself don't suffer from the issue, but it is theoretically possible
for Scintilla to emit signals anytime before it is destroyed, so it is
safer like this anyway.  And an user on IRC suffered from crashes on
quit because of this issue, so it seems to actually happen in some
situations.


Modified Paths:
--------------
    src/document.c

Modified: src/document.c
9 files changed, 8 insertions(+), 1 deletions(-)
===================================================================
@@ -592,7 +592,14 @@ static gboolean remove_page(guint page_num)
 
 	doc->is_valid = FALSE;
 
-	if (! main_status.quitting)
+	if (main_status.quitting)
+	{
+		/* we need to destroy the ScintillaWidget so our handlers on it are
+		 * disconnected before we free any data they may use (like the editor).
+		 * when not quitting, this is handled by removing the notebook page. */
+		gtk_widget_destroy(doc->editor->sci);
+	}
+	else
 	{
 		notebook_remove_page(page_num);
 		sidebar_remove_document(doc);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list