diff options
| author | 2008-11-22 20:26:21 +0000 | |
|---|---|---|
| committer | 2008-11-22 20:26:21 +0000 | |
| commit | 81a425e31debecf0970078579ea40482d6759ba6 (patch) | |
| tree | 6172b29b554ed5031fd158cdb901fc841b62dc93 | |
| parent | maybe fixed compilation about perlcore (diff) | |
| download | KVIrc-81a425e31debecf0970078579ea40482d6759ba6.tar.gz KVIrc-81a425e31debecf0970078579ea40482d6759ba6.tar.bz2 KVIrc-81a425e31debecf0970078579ea40482d6759ba6.zip | |
fix for #306
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@2913 17fca916-40b9-46aa-a4ea-0a15b648b75c
| -rw-r--r-- | src/kvirc/ui/kvi_console.cpp | 6 | ||||
| -rw-r--r-- | src/kvirc/ui/kvi_frame.cpp | 10 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/kvirc/ui/kvi_console.cpp b/src/kvirc/ui/kvi_console.cpp index 9ab683713..ca3b640fb 100644 --- a/src/kvirc/ui/kvi_console.cpp +++ b/src/kvirc/ui/kvi_console.cpp @@ -188,12 +188,6 @@ KviConsole::~KviConsole() KVS_TRIGGER_EVENT_0(KviEvent_OnIrcContextDestroyed,this); - if(g_pFrame->consoleCount() <= 1) - { - KVS_TRIGGER_EVENT_0(KviEvent_OnFrameWindowDestroyed,this); - KVS_TRIGGER_EVENT_0(KviEvent_OnKVIrcShutdown,this); - } - //if(m_pLastIrcServer)delete m_pLastIrcServer; delete m_pContext; diff --git a/src/kvirc/ui/kvi_frame.cpp b/src/kvirc/ui/kvi_frame.cpp index ea0f1be48..34a9287aa 100644 --- a/src/kvirc/ui/kvi_frame.cpp +++ b/src/kvirc/ui/kvi_frame.cpp @@ -561,6 +561,14 @@ void KviFrame::saveWindowProperties(KviWindow * wnd,const QString &szSection) void KviFrame::closeWindow(KviWindow *wnd) { + if (wnd->inherits("KviConsole")) + { + if (consoleCount() <= 1) + { + KVS_TRIGGER_EVENT_0(KviEvent_OnFrameWindowDestroyed,wnd); + KVS_TRIGGER_EVENT_0(KviEvent_OnKVIrcShutdown,wnd); + } + } // notify the destruction wnd->triggerDestructionEvents(); @@ -781,7 +789,7 @@ unsigned int KviFrame::consoleCount() unsigned int count = 0; for(KviWindow * wnd = m_pWinList->first();wnd;wnd = m_pWinList->next()) { - if(wnd->type() == KVI_WINDOW_TYPE_CONSOLE)count++; + if (wnd) if(wnd->type() == KVI_WINDOW_TYPE_CONSOLE) count++; } return count; } |
