From 0c0f973fd8e0e4b840f6f5b611f30dfc5d7cb38d Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Mon, 31 Dec 2007 06:45:20 +0000 Subject: [PATCH] fix leak when creating wxCURSOR_BLANK git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/cursor.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 0e778d1f8c..f9b7070753 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -48,13 +48,12 @@ wxCursorRefData::~wxCursorRefData() //----------------------------------------------------------------------------- -#define M_CURSORDATA ((wxCursorRefData *)m_refData) +#define M_CURSORDATA wx_static_cast(wxCursorRefData*, m_refData) -IMPLEMENT_DYNAMIC_CLASS(wxCursor,wxObject) +IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxGDIObject) wxCursor::wxCursor() { - } wxCursor::wxCursor( int cursorId ) @@ -66,8 +65,8 @@ wxCursor::wxCursor( int cursorId ) { case wxCURSOR_BLANK: { - static const gchar bits[] = { 0 }; - static /* const -- not in GTK1 */ GdkColor color = { 0, 0, 0, 0 }; + const char bits[] = { 0 }; + const GdkColor color = { 0, 0, 0, 0 }; GdkPixmap *pixmap = gdk_bitmap_create_from_data(NULL, bits, 1, 1); M_CURSORDATA->m_cursor = gdk_cursor_new_from_pixmap(pixmap, @@ -75,6 +74,7 @@ wxCursor::wxCursor( int cursorId ) &color, &color, 0, 0); + g_object_unref(pixmap); } return; -- 2.50.0