[gtkmm] Reference the returned statusicon because the RefPtr becomes invalid otherwise



commit 00d6b836f5a9b71454c7024a560837809e815817
Author: Johannes Schmid <jhs gnome org>
Date:   Mon Apr 27 11:00:55 2009 +0200

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

diff --git a/ChangeLog b/ChangeLog
index 876168b..2c4f1a0 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-18  Daniel Elstner  <danielk openismus com>
 
 	* docs/reference/images/stock: Add these stock images to the repository for
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]