Kaydet (Commit) 3cf35f24 authored tarafından Colomban Wendling's avatar Colomban Wendling

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.
üst f74b4ed4
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment