Kaydet (Commit) 1421a3f9 authored tarafından Colomban Wendling's avatar Colomban Wendling

scintilla: Fix crash after destroying the widget on GTK < 3.3.6

On GTK2 and GTK3 < 3.3.6 there is no GtkAccessibleClass::widget_unset()
method, so we can't destroy our accessible object right away.  So, to
avoid accessing a destroyed widget, we need to check whether the widget
still exists in the the ScintillaGTKAccessible destructor.

In other methods it's not necessary because the wrapping GObject class
makes sure not to forward other when the widget has been destroyed, but
we still have to destroy the C++ instance no matter what, so the check
has to be on this side.

Fixes #1410.
üst df05fc87
...@@ -162,7 +162,9 @@ ScintillaGTKAccessible::ScintillaGTKAccessible(GtkAccessible *accessible_, GtkWi ...@@ -162,7 +162,9 @@ ScintillaGTKAccessible::ScintillaGTKAccessible(GtkAccessible *accessible_, GtkWi
} }
ScintillaGTKAccessible::~ScintillaGTKAccessible() { ScintillaGTKAccessible::~ScintillaGTKAccessible() {
g_signal_handlers_disconnect_matched(sci->sci, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, this); if (gtk_accessible_get_widget(accessible)) {
g_signal_handlers_disconnect_matched(sci->sci, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, this);
}
} }
gchar *ScintillaGTKAccessible::GetTextRangeUTF8(Position startByte, Position endByte) { gchar *ScintillaGTKAccessible::GetTextRangeUTF8(Position startByte, Position endByte) {
......
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