[geany/geany] 6834c5: GTK: Don't forward calls to NULL scrollbars

Colomban Wendling git-noreply at geany.org
Mon Oct 24 09:03:58 UTC 2016


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Mon, 24 Oct 2016 09:03:58 UTC
Commit:      6834c5a830a3e446a89560fb04a207f099acf5de
             https://github.com/geany/geany/commit/6834c5a830a3e446a89560fb04a207f099acf5de

Log Message:
-----------
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.

Closes #993.

X-Scintilla-Bug-URL: https://sourceforge.net/p/scintilla/bugs/1873/
X-Scintilla-Commit-ID: 4e67e6ee45732a048907ef1577cf1efc25729313


Modified Paths:
--------------
    scintilla/gtk/ScintillaGTK.cxx

Modified: scintilla/gtk/ScintillaGTK.cxx
12 lines changed, 8 insertions(+), 4 deletions(-)
===================================================================
@@ -546,8 +546,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);
@@ -611,8 +613,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;
 	}



--------------
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