[gtkmm/local-gtkmm-3maybe: 1/2] Reference the returned statusicon because the RefPtr becomes invalid



commit 9257303a2ba371ae9e965d4839e7bda6074d3cda
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Apr 28 01:51:15 2009 +0200

    Reference the returned statusicon because the RefPtr becomes invalid
    otherwise (#575268)
---
 ChangeLog              |    6 ++++++
 gtk/src/statusicon.ccg |    3 +++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fa91c33..0b6de16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-27  Johannes Schmid <jschmid openismus com>
+
+	* gtk/src/statusicon.ccg:
+	Reference the returned statusicon because the RefPtr becomes invalid
+	otherwise (#575268)
+
 2009-04-24  Murray Cumming  <murrayc murrayc com>
 
 	Derive classes from CellLayout, CellEditable, and Orientable.
diff --git a/gtk/src/statusicon.ccg b/gtk/src/statusicon.ccg
index f700b8b..4abafac 100644
--- a/gtk/src/statusicon.ccg
+++ b/gtk/src/statusicon.ccg
@@ -38,7 +38,10 @@ bool StatusIcon::get_geometry(Glib::RefPtr<Gdk::Screen>& screen, Gdk::Rectangle&
   const bool result = gtk_status_icon_get_geometry(const_cast<GtkStatusIcon*>(gobj()), &cscreen, &carea, (GtkOrientation*)(&orientation));
 
   if(cscreen)
+  {
     screen = Glib::wrap(cscreen);
+    screen->reference();
+  }
 
   *(area.gobj()) = carea;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]