From fdf7ff738cb755be0e9e7e1378d8c3073f08f0e1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 22 Mar 2008 04:19:12 +0000 Subject: [PATCH] make wxSelectDispatcher ctor public, it can be useful to create it in places other than wxFDIODispatcher git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/private/selectdispatcher.h | 8 ++------ src/common/fdiodispatcher.cpp | 2 +- src/common/selectdispatcher.cpp | 11 ----------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/include/wx/private/selectdispatcher.h b/include/wx/private/selectdispatcher.h index 9d75cdd77f..9ee71d4f9f 100644 --- a/include/wx/private/selectdispatcher.h +++ b/include/wx/private/selectdispatcher.h @@ -82,8 +82,8 @@ private: class WXDLLIMPEXP_BASE wxSelectDispatcher : public wxMappedFDIODispatcher { public: - // creates an instance of this class, the caller takes ownership of it - static wxSelectDispatcher *Create(); + // default ctor + wxSelectDispatcher() { m_maxFD = -1; } // implement pure virtual methods of the base class virtual bool RegisterFD(int fd, wxFDIOHandler *handler, int flags = wxFDIO_ALL); @@ -91,10 +91,6 @@ public: virtual bool UnregisterFD(int fd); virtual void Dispatch(int timeout = TIMEOUT_INFINITE); -protected: - // ctor is not public, use Create() - wxSelectDispatcher(); - private: // common part of RegisterFD() and ModifyFD() bool DoUpdateFDAndHandler(int fd, wxFDIOHandler *handler, int flags); diff --git a/src/common/fdiodispatcher.cpp b/src/common/fdiodispatcher.cpp index 65c862cf88..83573829c1 100644 --- a/src/common/fdiodispatcher.cpp +++ b/src/common/fdiodispatcher.cpp @@ -54,7 +54,7 @@ wxFDIODispatcher *wxFDIODispatcher::Get() if ( !gs_dispatcher ) #endif // wxUSE_EPOLL_DISPATCHER #if wxUSE_SELECT_DISPATCHER - gs_dispatcher = wxSelectDispatcher::Create(); + gs_dispatcher = new wxSelectDispatcher(); #endif // wxUSE_SELECT_DISPATCHER } diff --git a/src/common/selectdispatcher.cpp b/src/common/selectdispatcher.cpp index d3461b2b2f..ffcf387179 100644 --- a/src/common/selectdispatcher.cpp +++ b/src/common/selectdispatcher.cpp @@ -131,17 +131,6 @@ void wxSelectSets::Handle(int fd, wxFDIOHandler& handler) const // wxSelectDispatcher // ---------------------------------------------------------------------------- -/* static */ -wxSelectDispatcher *wxSelectDispatcher::Create() -{ - return new wxSelectDispatcher; -} - -wxSelectDispatcher::wxSelectDispatcher() -{ - m_maxFD = -1; -} - bool wxSelectDispatcher::RegisterFD(int fd, wxFDIOHandler *handler, int flags) { if ( !wxMappedFDIODispatcher::RegisterFD(fd, handler, flags) ) -- 2.45.2