From: Vadim Zeitlin Date: Wed, 2 May 2001 13:35:14 +0000 (+0000) Subject: fixed (?) crashes because of default GUI font being deleted X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b1d1dc510df81a53b23f351b89c6d8624a0da5e3 fixed (?) crashes because of default GUI font being deleted git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index 1da01a2ed0..c8a4c8da16 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -493,6 +493,12 @@ GdkFont *GtkGetDefaultGuiFont() } gtk_widget_destroy( widget ); } + else + { + // already have it, but ref it once more before returning + gdk_font_ref(g_systemDefaultGuiFont); + } + return g_systemDefaultGuiFont; } diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 1da01a2ed0..c8a4c8da16 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -493,6 +493,12 @@ GdkFont *GtkGetDefaultGuiFont() } gtk_widget_destroy( widget ); } + else + { + // already have it, but ref it once more before returning + gdk_font_ref(g_systemDefaultGuiFont); + } + return g_systemDefaultGuiFont; }