From 18c98e42eeb75317f75c9ba20b09a5bd531a690c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Karsten=20Ball=C3=BCder?= Date: Sat, 23 Oct 1999 11:01:02 +0000 Subject: [PATCH] minor bug fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4151 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/unix/dialup.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index 2dac8544b8..d97ea36041 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -228,10 +228,14 @@ public: { m_DupMan = dupman; } + void Disconnect(void) { m_DupMan = NULL; } void OnTerminate(int WXUNUSED(pid), int WXUNUSED(status)) const { - m_DupMan->m_DialProcess = NULL; - m_DupMan->CheckStatus(TRUE); + if(m_DupMan) + { + m_DupMan->m_DialProcess = NULL; + m_DupMan->CheckStatus(TRUE); + } } private: wxDialUpManagerImpl *m_DupMan; @@ -240,7 +244,7 @@ private: wxDialUpManagerImpl::wxDialUpManagerImpl() { - m_IsOnline = -1; // unknown + m_IsOnline = -2; // -1 or -2, unknown m_DialProcess = NULL; m_timer = NULL; m_CanUseIfconfig = -1; // unknown @@ -257,7 +261,11 @@ wxDialUpManagerImpl::wxDialUpManagerImpl() wxDialUpManagerImpl::~wxDialUpManagerImpl() { if(m_timer) delete m_timer; - if(m_DialProcess) m_DialProcess->Detach(); + if(m_DialProcess) + { + m_DialProcess->Disconnect(); + m_DialProcess->Detach(); + } } bool @@ -373,7 +381,7 @@ wxDialUpManagerImpl::CheckStatus(bool fromAsync) const ( /* non-const */ (wxDialUpManagerImpl *)this)->CheckStatusInternal(); // now send the events as appropriate: - if(m_IsOnline != oldIsOnline && oldIsOnline != -1) + if(m_IsOnline != oldIsOnline && m_IsOnline != -1 && oldIsOnline != -2) // -2: first time! { wxDialUpEvent event(m_IsOnline, ! fromAsync); (void)wxTheApp->ProcessEvent(event); -- 2.45.2