[kwindowsystem] src: Preventing a crash in the KWindowInfo::Private destructor on OSX

Marko Käning mk-lists at email.de
Tue Jul 15 23:02:00 UTC 2014


Git commit 10398255165afda1a0ecddd1671bbb599846bb35 by Marko Käning.
Committed on 15/07/2014 at 22:51.
Pushed by kaning into branch 'master'.

Preventing a crash in the KWindowInfo::Private destructor on OSX

René J.V. Bertin found that Apple's developer documentation for
CFRelease mentions that its argument may not be a NULL pointer.

BUG: 337154
CCMAIL: kde-frameworks-devel at kde.org
REVIEW: 119240

M  +3    -1    src/kwindowinfo_mac.cpp

http://commits.kde.org/kwindowsystem/10398255165afda1a0ecddd1671bbb599846bb35

diff --git a/src/kwindowinfo_mac.cpp b/src/kwindowinfo_mac.cpp
index ec4e9bb..328d6a9 100644
--- a/src/kwindowinfo_mac.cpp
+++ b/src/kwindowinfo_mac.cpp
@@ -48,7 +48,9 @@ void KWindowInfo::Private::setProcessSerialNumber(const ProcessSerialNumber &psn
 
 KWindowInfo::Private::~Private()
 {
-    CFRelease(m_axWin);
+    if (m_axWin) {
+        CFRelease(m_axWin);
+    }
 }
 
 void KWindowInfo::Private::updateData()


More information about the Kde-frameworks-devel mailing list