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

List:       kde-core-devel
Subject:    [PATCH] Solid circular deletion
From:       Alex Merry <huntedhacker () tiscali ! co ! uk>
Date:       2008-02-19 1:21:24
Message-ID: 200802190121.30590.huntedhacker () tiscali ! co ! uk
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Plasma keeps on crashing when removing external devices due to a segfault in S
olid.

gdb gives a circular backtrace like this:
#953 0xb74323b3 in ~DevicePrivate (this=0x8092650) at /home/kde-devel/src/KDE/
kdelibs/solid/solid/device.cpp:250
#954 0xb7433530 in ~QExplicitlySharedDataPointer (this=0x8092668)
    at /home/kde-devel/src/qt-copy/include/QtCore/../../src/corelib/tools/qsha
reddata.h:172
#955 0xb74323b3 in ~DevicePrivate (this=0x8092650) at /home/kde-devel/src/KDE/
kdelibs/solid/solid/device.cpp:250
#956 0xb7433530 in ~QExplicitlySharedDataPointer (this=0x8092668)

The attached patch seems to fix it, but I'm not sure if it's really the correc
t fix - can someone who knows about the code (or using QExplicitlySharedPointe
r as a self reference) check it?  It may introduce memory leaks.

Alex


-- 
KDE: http://www.kde.org
Ubuntu/Kubuntu: http://www.ubuntu.org http://www.kubuntu.org


["solid.diff" (text/x-patch)]

Index: device.cpp
===================================================================
--- device.cpp	(revision 776904)
+++ device.cpp	(working copy)
@@ -244,7 +244,7 @@ Solid::DevicePrivate::~DevicePrivate()
 {
     // In case we're still referencing ourself otherwise
     // we get a double delete because of m_refToSelf deletion
-    ref.ref();
+    m_refToSelf = 0;
 
     qDeleteAll(m_ifaces.values());
 }

["signature.asc" (application/pgp-signature)]

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

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