another wxBeginBusyCursor fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-02-23 19:05:55 +00:00
parent 7c39369e5a
commit 89a43902a8
2 changed files with 16 additions and 2 deletions

View File

@@ -140,9 +140,13 @@ 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()?" );
@@ -153,6 +157,9 @@ void wxEndBusyCursor()
void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
{
if ( gs_busyCount++ > 0 )
return;
wxASSERT_MSG( !gs_savedCursor,
"forgot to call wxEndBusyCursor, will leak memory" );
@@ -166,7 +173,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
bool wxIsBusy()
{
return gs_savedCursor != NULL;
return gs_busyCount > 0;
}
void wxSetCursor( const wxCursor& cursor )