X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7523de907dd77eedd33431d5ff46478a467faf5f..850df2d78866c3edcf848103b5dbc7e7fa1ee5fa:/src/common/selectdispatcher.cpp diff --git a/src/common/selectdispatcher.cpp b/src/common/selectdispatcher.cpp index 654eee9f4a..0188a76ec0 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 @@ -32,6 +31,7 @@ #endif #ifdef HAVE_SYS_SELECT_H + #include #include #endif @@ -132,26 +132,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 +248,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