aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Fabio Bas2009-03-24 15:42:04 +0000
committerGravatar Fabio Bas2009-03-24 15:42:04 +0000
commit214ba879669aaadf0b5ecf651a8d41c93b86d284 (patch)
treedc604b1a1e7d094e7706abb2a069b48f9049737e /src
parentapplied a patch from Kebianizao to reduce the number of warnings (diff)
downloadKVIrc-214ba879669aaadf0b5ecf651a8d41c93b86d284.tar.gz
KVIrc-214ba879669aaadf0b5ecf651a8d41c93b86d284.tar.bz2
KVIrc-214ba879669aaadf0b5ecf651a8d41c93b86d284.zip
fixed a crash in mdichild management (closing a not-maximized not-channel window)
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3159 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src')
-rw-r--r--src/kvirc/ui/kvi_mdichild.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/kvirc/ui/kvi_mdichild.cpp b/src/kvirc/ui/kvi_mdichild.cpp
index 20f69113d..905261686 100644
--- a/src/kvirc/ui/kvi_mdichild.cpp
+++ b/src/kvirc/ui/kvi_mdichild.cpp
@@ -113,7 +113,18 @@ KviMdiChild::~KviMdiChild()
void KviMdiChild::closeEvent(QCloseEvent * e)
{
- widget()->close();
+ //this is tricky: first save a reference to our internal widget
+ QWidget * pClient = widget();
+ if(pClient)
+ {
+ //then, let's forget about it and make it forget about us
+ widget()->setParent(0);
+ unsetClient();
+ //make kviframe close it "the delete way"
+ pClient->close();
+ }
+ //while we survive for closing ourselves "the deleteLater() way"
+ deleteLater();
e->ignore();
}