X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7523de907dd77eedd33431d5ff46478a467faf5f..180b5b4827d08f1ac13bbb5eca03f775ab35a0b1:/src/common/selectdispatcher.cpp diff --git a/src/common/selectdispatcher.cpp b/src/common/selectdispatcher.cpp index 654eee9f4a..f13df0daa6 100644 --- a/src/common/selectdispatcher.cpp +++ b/src/common/selectdispatcher.cpp @@ -22,7 +22,6 @@ #if wxUSE_SELECT_DISPATCHER #include "wx/private/selectdispatcher.h" -#include "wx/module.h" #include "wx/unix/private.h" #ifndef WX_PRECOMP @@ -132,26 +131,10 @@ void wxSelectSets::Handle(int fd, wxFDIOHandler& handler) const // wxSelectDispatcher // ---------------------------------------------------------------------------- -static wxSelectDispatcher *gs_selectDispatcher = NULL; - -/* static */ -wxSelectDispatcher *wxSelectDispatcher::Get() -{ - if ( !gs_selectDispatcher ) - { - // the dispatcher should be only created from one thread so it should - // be ok to use a global without any protection here - gs_selectDispatcher = new wxSelectDispatcher; - } - - return gs_selectDispatcher; -} - /* static */ -void wxSelectDispatcher::DispatchPending() +wxSelectDispatcher *wxSelectDispatcher::Create() { - if ( gs_selectDispatcher ) - gs_selectDispatcher->Dispatch(0); + return new wxSelectDispatcher; } wxSelectDispatcher::wxSelectDispatcher() @@ -264,20 +247,4 @@ void wxSelectDispatcher::Dispatch(int timeout) } } -// ---------------------------------------------------------------------------- -// wxSelectDispatcherModule -// ---------------------------------------------------------------------------- - -class wxSelectDispatcherModule : public wxModule -{ -public: - virtual bool OnInit() { return true; } - virtual void OnExit() { wxDELETE(gs_selectDispatcher); } - -private: - DECLARE_DYNAMIC_CLASS(wxSelectDispatcherModule) -}; - -IMPLEMENT_DYNAMIC_CLASS(wxSelectDispatcherModule, wxModule) - #endif // wxUSE_SELECT_DISPATCHER