<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Consolas'; font-size:11pt; font-weight:400; font-style:normal;">Hi all,<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>While valgrinding JuK's shutdown sequence I came across a lot of errors on<br>
KMainWindowPrivate::setSettinsDirty. (example:<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>==18070== Invalid read of size 8                                                                              <br>
==18070==    at 0x6F42F63: KMainWindowPrivate::setSettingsDirty(KMainWindowPrivate::CallCompression) (kmainwindow.cpp:392)<br>
==18070==    by 0x6F43235: DockResizeListener::eventFilter(QObject*, QEvent*) (kmainwindow.cpp:121)<br>
==18070==    by 0x7CF773D: QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) (qcoreapplication.cpp:710)<br>
==18070==    by 0x86F3F0F: QApplicationPrivate::notify_helper(QObject*, QEvent*) (qapplication.cpp:4043)<br>
==18070==    by 0x86F8AE4: QApplication::notify(QObject*, QEvent*) (qapplication.cpp:4012)<br>
==18070==    by 0x6E6FFCA: KApplication::notify(QObject*, QEvent*) (kapplication.cpp:307)<br>
==18070==    by 0x7CF7393: QCoreApplication::notifyInternal(QObject*, QEvent*) (qcoreapplication.cpp:594)<br>
==18070==    by 0x87412B0: QWidgetPrivate::hideChildren(bool)(qcoreapplication.h:208)<br>
==18070==    by 0x87413D5: QWidgetPrivate::hide_helper() (qwidget.cpp:6735)<br>
==18070==    by 0x87476F2: QWidget::setVisible(bool) (qwidget.cpp:6904)<br>
==18070==    by 0x873D696: QWidget::~QWidget() (qwidget.h:472)<br>
==18070==    by 0x6F44EE8: KMainWindow::~KMainWindow() (kmainwindow.cpp:466)<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Looking at the code, it's due to a DockResizeListener object installing an event filter on the KMainWindow.  The DRL itself is part of KMainWindowPrivate, which gets deleted in the KMainWindow dtor.  The DRL is owned by by KMainWindow being deleted so as far as I see it the window where this flaw could cause problems is small but I don't think the patch hurts anything and I'd like to fix it anyways.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Any objections to the following patch?  Otherwise I'll commit and backport to 4.2.1.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Index: kmainwindow.cpp<br>
===================================================================<br>
--- kmainwindow.cpp     (revision 916788)<br>
+++ kmainwindow.cpp     (working copy)<br>
@@ -461,6 +461,8 @@<br>
 KMainWindow::~KMainWindow()<br>
 {<br>
     sMemberList->removeAll( this );<br>
+    // This can be called after the delete k_ptr while we're still alive, kill it now<br>
+    delete k_ptr->dockResizeListener;<br>
     delete k_ptr;<br>
     KGlobal::deref();<br>
 }<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Regards,<br>
 - Michael Pyne</p></body></html>