X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7523de907dd77eedd33431d5ff46478a467faf5f..f0875501313903140a41dca0ba6ee2d85ed0536c:/src/common/selectdispatcher.cpp diff --git a/src/common/selectdispatcher.cpp b/src/common/selectdispatcher.cpp index 654eee9f4a..9321e7c837 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 @@ -31,7 +30,8 @@ #include "wx/intl.h" #endif -#ifdef HAVE_SYS_SELECT_H +#if defined(HAVE_SYS_SELECT_H) || defined(__WATCOMC__) + #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