[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/3.5/kdebase/kdialog
From:       David Faure <faure () kde ! org>
Date:       2006-04-09 22:11:00
Message-ID: 1144620660.836682.11026.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 528040 by dfaure:

Using deleteLater is safer here.


 M  +7 -4      kdialog.cpp  


--- branches/KDE/3.5/kdebase/kdialog/kdialog.cpp #528039:528040
@@ -52,6 +52,8 @@
 #include <netwm.h>
 #endif
 
+#include <assert.h>
+
 using namespace std;
 
 #if defined(Q_WS_X11)
@@ -105,9 +107,10 @@
 class WinIdEmbedder: public QObject
 {
 public:
-    WinIdEmbedder(bool printID = false, WId winId = 0):
+    WinIdEmbedder(bool printID, WId winId):
         QObject(qApp), print(printID), id(winId)
     {
+        assert( id );
         if (qApp)
             qApp->installEventFilter(this);
     }
@@ -127,10 +130,10 @@
         if (print)
             cout << "winId: " << w->winId() << endl;
 #ifdef Q_WS_X11
-        if (id)
-            XSetTransientForHint(w->x11Display(), w->winId(), id);
+        XSetTransientForHint(w->x11Display(), w->winId(), id);
 #endif
-        delete this; // delete - set the transient hint only on the first dialog
+        deleteLater(); // delete - set the transient hint only on the first dialog
+        return false;
     }
     return QObject::eventFilter(o, e);
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic