X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c39369e5a9b2298eed8adc64a229482d5d90dd1..c127177f8dc31dbe99764852b8dbcc047d3ad826:/src/gtk/cursor.cpp diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 93c10ada60..3c22177973 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -84,7 +84,7 @@ wxCursor::wxCursor( int cursorId ) case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break; */ default: - wxFAIL_MSG("unsupported cursor type"); + wxFAIL_MSG(_T("unsupported cursor type")); // will use the standard one case wxCURSOR_ARROW: @@ -140,11 +140,15 @@ GdkCursor *wxCursor::GetCursor() const extern wxCursor *g_globalCursor; static wxCursor *gs_savedCursor = NULL; +static int gs_busyCount = 0; void wxEndBusyCursor() { + if ( --gs_busyCount > 0 ) + return; + wxCHECK_RET( gs_savedCursor && gs_savedCursor->Ok(), - "calling wxEndBusyCursor() without wxBeginBusyCursor()?" ); + _T("calling wxEndBusyCursor() without wxBeginBusyCursor()?") ); wxSetCursor(*gs_savedCursor); delete gs_savedCursor; @@ -153,8 +157,11 @@ void wxEndBusyCursor() void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) { + if ( gs_busyCount++ > 0 ) + return; + wxASSERT_MSG( !gs_savedCursor, - "forgot to call wxEndBusyCursor, will leak memory" ); + _T("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = new wxCursor; if ( g_globalCursor && g_globalCursor->Ok() ) @@ -166,12 +173,10 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) bool wxIsBusy() { - return gs_savedCursor != NULL; + return gs_busyCount > 0; } void wxSetCursor( const wxCursor& cursor ) { if (g_globalCursor) (*g_globalCursor) = cursor; } - -