]> git.saurik.com Git - wxWidgets.git/commitdiff
Unregister wake up pipe file fd in ~wxConsoleEventLoop.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 12 Sep 2009 22:40:18 +0000 (22:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 12 Sep 2009 22:40:18 +0000 (22:40 +0000)
We must unregister the wake up pipe file descriptor which we register with the
IO dispatcher in wxConsoleEventLoop ctor, otherwise doing it the next time
(i.e. if wxConsoleEventLoop is deleted and recreated) results in asserts, at
least when using wxSelectDispatcher and not wxEpollDispatcher (i.e. under any
non-Linux Unix system).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61895 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/evtloopunix.cpp

index a44933e593ccc965662d5c0ed45b835368119993..3baef89f9bbbe9fd421461af2678ba8db9828d5c 100644 (file)
@@ -176,7 +176,15 @@ wxConsoleEventLoop::wxConsoleEventLoop()
 
 wxConsoleEventLoop::~wxConsoleEventLoop()
 {
-    delete m_wakeupPipe;
+    if ( m_wakeupPipe )
+    {
+        if ( m_dispatcher )
+        {
+            m_dispatcher->UnregisterFD(m_wakeupPipe->GetReadFd());
+        }
+
+        delete m_wakeupPipe;
+    }
 }
 
 //-----------------------------------------------------------------------------