diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2016-10-23 10:41:27 +0200 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2016-10-23 10:41:27 +0200 |
commit | e9657ea868fd2fc92175e98954e077b58805efb8 (patch) | |
tree | d2a03f5187660636d0c9cb0ea74c1214b3c67312 | |
parent | 6a54dbb6512ea1511e3cd24ec933e7b1c86b5ca4 (diff) | |
download | scintilla-mirror-e9657ea868fd2fc92175e98954e077b58805efb8.tar.gz |
Bug [#1873]. GTK: Don't forward calls to NULL scrollbars
Once Dispose() has been called, scrollbars will be NULL, so we need to
check against this in code that might run after Dispose().
Fixes scary warnings on certain widget destruction scenarios.
-rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
-rw-r--r-- | gtk/ScintillaGTK.cxx | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 20be5e5a8..b6ced2dea 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -537,6 +537,10 @@ Margin click to select line now clears rectangular and additional selections. </li> <li> + Fixed a NULL access bug on GTK+ where the scrollbars could be used during destruction. + <a href="http://sourceforge.net/p/scintilla/bugs/1873/">Bug #1873</a>. + </li> + <li> A potential bug on GTK+ fixed where asynchronous clipboard could be delivered after its target Scintilla instance was destroyed. </li> diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 2d5daa2f0..70261bce1 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -323,8 +323,10 @@ void ScintillaGTK::UnRealizeThis(GtkWidget *widget) { GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED); #endif gtk_widget_unrealize(PWidget(wText)); - gtk_widget_unrealize(PWidget(scrollbarv)); - gtk_widget_unrealize(PWidget(scrollbarh)); + if (PWidget(scrollbarv)) + gtk_widget_unrealize(PWidget(scrollbarv)); + if (PWidget(scrollbarh)) + gtk_widget_unrealize(PWidget(scrollbarh)); gtk_widget_unrealize(PWidget(wPreedit)); gtk_widget_unrealize(PWidget(wPreeditDraw)); g_object_unref(im_context); @@ -388,8 +390,10 @@ void ScintillaGTK::UnMapThis() { DropGraphics(false); gdk_window_hide(PWindow(wMain)); gtk_widget_unmap(PWidget(wText)); - gtk_widget_unmap(PWidget(scrollbarh)); - gtk_widget_unmap(PWidget(scrollbarv)); + if (PWidget(scrollbarh)) + gtk_widget_unmap(PWidget(scrollbarh)); + if (PWidget(scrollbarv)) + gtk_widget_unmap(PWidget(scrollbarv)); } catch (...) { errorStatus = SC_STATUS_FAILURE; } |