[geany/geany] 3d439b: Backport Scintilla patch correctly disposing scrollbars
Jiří Techet
git-noreply at xxxxx
Sat Nov 14 09:26:07 UTC 2015
Branch: refs/heads/master
Author: Jiří Techet <techet at gmail.com>
Committer: Jiří Techet <techet at gmail.com>
Date: Sat, 14 Nov 2015 09:26:07 UTC
Commit: 3d439b4cfc42652d923bd5b9c454fde6d3737e4a
https://github.com/geany/geany/commit/3d439b4cfc42652d923bd5b9c454fde6d3737e4a
Log Message:
-----------
Backport Scintilla patch correctly disposing scrollbars
The unparent method should be called in dispose(), not in finalize().
This patch fixes that which removes some ugly warnings from OS X command
line.
Modified Paths:
--------------
scintilla/gtk/ScintillaGTK.cxx
Modified: scintilla/gtk/ScintillaGTK.cxx
32 lines changed, 27 insertions(+), 5 deletions(-)
===================================================================
@@ -302,6 +302,7 @@ class ScintillaGTK : public ScintillaBase {
static void StyleSetText(GtkWidget *widget, GtkStyle *previous, void*);
static void RealizeText(GtkWidget *widget, void*);
+ static void Dispose(GObject *object);
static void Destroy(GObject *object);
static void SelectionReceived(GtkWidget *widget, GtkSelectionData *selection_data,
guint time);
@@ -617,8 +618,10 @@ void ScintillaGTK::UnMap(GtkWidget *widget) {
void ScintillaGTK::ForAll(GtkCallback callback, gpointer callback_data) {
try {
(*callback) (PWidget(wText), callback_data);
- (*callback) (PWidget(scrollbarv), callback_data);
- (*callback) (PWidget(scrollbarh), callback_data);
+ if (PWidget(scrollbarv))
+ (*callback) (PWidget(scrollbarv), callback_data);
+ if (PWidget(scrollbarh))
+ (*callback) (PWidget(scrollbarh), callback_data);
} catch (...) {
errorStatus = SC_STATUS_FAILURE;
}
@@ -2584,6 +2587,27 @@ void ScintillaGTK::RealizeText(GtkWidget *widget, void*) {
static GObjectClass *scintilla_class_parent_class;
+void ScintillaGTK::Dispose(GObject *object) {
+ try {
+ ScintillaObject *scio = reinterpret_cast<ScintillaObject *>(object);
+ ScintillaGTK *sciThis = reinterpret_cast<ScintillaGTK *>(scio->pscin);
+
+ if (PWidget(sciThis->scrollbarv)) {
+ gtk_widget_unparent(PWidget(sciThis->scrollbarv));
+ sciThis->scrollbarv = NULL;
+ }
+
+ if (PWidget(sciThis->scrollbarh)) {
+ gtk_widget_unparent(PWidget(sciThis->scrollbarh));
+ sciThis->scrollbarh = NULL;
+ }
+
+ scintilla_class_parent_class->dispose(object);
+ } catch (...) {
+ // Its dying so nowhere to save the status
+ }
+}
+
void ScintillaGTK::Destroy(GObject *object) {
try {
ScintillaObject *scio = reinterpret_cast<ScintillaObject *>(object);
@@ -2595,9 +2619,6 @@ void ScintillaGTK::Destroy(GObject *object) {
//Platform::DebugPrintf("Destroying %x %x\n", sciThis, object);
sciThis->Finalise();
- gtk_widget_unparent(PWidget(sciThis->scrollbarv));
- gtk_widget_unparent(PWidget(sciThis->scrollbarh));
-
delete sciThis;
scio->pscin = 0;
scintilla_class_parent_class->finalize(object);
@@ -3114,6 +3135,7 @@ void ScintillaGTK::ClassInit(OBJECT_CLASS* object_class, GtkWidgetClass *widget_
// in Initialise() may require coordinate translation?)
object_class->finalize = Destroy;
+ object_class->dispose = Dispose;
#if GTK_CHECK_VERSION(3,0,0)
widget_class->get_preferred_width = GetPreferredWidth;
widget_class->get_preferred_height = GetPreferredHeight;
--------------
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