]>
git.saurik.com Git - wxWidgets.git/blob - src/common/appcmn.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: common/appcmn.cpp
3 // Purpose: wxAppBase methods common to all platforms
4 // Author: Vadim Zeitlin
8 // Copyright: (c) Vadim Zeitlin
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
21 #pragma implementation "appbase.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
27 #if defined(__BORLANDC__)
36 #include "wx/thread.h"
37 #include "wx/confbase.h"
39 // ===========================================================================
41 // ===========================================================================
43 // ---------------------------------------------------------------------------
45 // ----------------------------------------------------------------------------
47 void wxAppBase::ProcessPendingEvents()
49 // ensure that we're the only thread to modify the pending events list
50 wxENTER_CRIT_SECT( *wxPendingEventsLocker
);
52 if ( !wxPendingEvents
)
54 wxLEAVE_CRIT_SECT( *wxPendingEventsLocker
);
58 // iterate until the list becomes empty
59 wxNode
*node
= wxPendingEvents
->First();
62 wxEvtHandler
*handler
= (wxEvtHandler
*)node
->Data();
65 // In ProcessPendingEvents(), new handlers might be add
66 // and we can safely leave the critical section here.
67 wxLEAVE_CRIT_SECT( *wxPendingEventsLocker
);
68 handler
->ProcessPendingEvents();
69 wxENTER_CRIT_SECT( *wxPendingEventsLocker
);
71 node
= wxPendingEvents
->First();
74 wxLEAVE_CRIT_SECT( *wxPendingEventsLocker
);
77 int wxAppBase::OnExit()
80 // delete the config object if any (don't use Get() here, but Set()
81 // because Get() could create a new config object)
82 delete wxConfigBase::Set((wxConfigBase
*) NULL
);
83 #endif // wxUSE_CONFIG