]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/textctrl.cpp
making things compile and build again ...
[wxWidgets.git] / src / gtk1 / textctrl.cpp
index b789f65908ca7ec3cc40c9c2030d6fd26a190612..9dfc2f18575b45e3d13fad8e58d41d51d47e117f 100644 (file)
@@ -55,8 +55,21 @@ static void wxGtkTextInsert(GtkWidget *text,
                             const char *txt,
                             size_t len)
 {
-    GdkFont *font = attr.HasFont() ? attr.GetFont().GetInternalFont()
-                                   : NULL;
+    wxFont tmpFont;
+    GdkFont *font;
+    if (attr.HasFont())
+    {
+        tmpFont = attr.GetFont();
+
+        // FIXME: if this crashes because tmpFont goes out of scope and the GdkFont is
+        // deleted, then we need to call gdk_font_ref on font.
+        // This is because attr.GetFont() now returns a temporary font since wxTextAttr
+        // no longer stores a wxFont object, for efficiency.
+
+        font = tmpFont.GetInternalFont();
+    }
+    else
+        font  = NULL;
 
     GdkColor *colFg = attr.HasTextColour() ? attr.GetTextColour().GetColor()
                                            : NULL;