From 0df7d5a03a3f3681294d246d3b3adcf9a9d01485 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Thu, 2 Feb 2017 14:33:56 +0100 Subject: [PATCH] scintilla: Prevent running signal handlers on a destroyed a11y object Avoid crash when detaching the widget from the accessible object without destroying that widget. In such situations, the widget is still valid but we will have destroyed the orphaned accessible object. Thus, we must make sure we disconnected the signal handlers the late accessible had set up on the widget, as they won't be implicitly disconnected by widget finalization in this case. Fixes #1385. --- scintilla/gtk/ScintillaGTKAccessible.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/scintilla/gtk/ScintillaGTKAccessible.cxx b/scintilla/gtk/ScintillaGTKAccessible.cxx index ecf843ce5..ff30141ef 100644 --- a/scintilla/gtk/ScintillaGTKAccessible.cxx +++ b/scintilla/gtk/ScintillaGTKAccessible.cxx @@ -162,6 +162,7 @@ ScintillaGTKAccessible::ScintillaGTKAccessible(GtkAccessible *accessible_, GtkWi } ScintillaGTKAccessible::~ScintillaGTKAccessible() { + g_signal_handlers_disconnect_by_func (sci->sci, reinterpret_cast(SciNotify), this); } gchar *ScintillaGTKAccessible::GetTextRangeUTF8(Position startByte, Position endByte) { -- 2.11.4.GIT