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

List:       kde-kimageshop
Subject:    Patch for crash on closing
From:       Sven Langkamp <sven.langkamp () gmail ! com>
Date:       2009-10-23 0:22:07
Message-ID: 478b087a0910221722w5fe5f4a6u6711038fb091475b () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

after my patch from yesterday all KOffice apps are now crashing on closing.
The problem is that the registry deletes the colospaces in the destructor
and the colorspace use the registry to get the cache.
The patch change the behavior so that colorspaces owned by the registry
don't delete the cached conversion themself. Instead this is done with the
destruction of the cache.

Can you have a look at it?



Sven

[Attachment #5 (text/html)]

Hi,<br><br>after my patch from yesterday all KOffice apps are now crashing =
on closing. The problem is that the registry deletes the colospaces in the =
destructor and the colorspace use the registry to get the cache.<br>The pat=
ch change the behavior so that colorspaces owned by the registry don&#39;t =
delete the cached conversion themself. Instead this is done with the destru=
ction of the cache.<br>
<br>Can you have a look at it?<br><br><br><br>Sven<br>

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

Index: KoColorSpaceRegistry.cpp
===================================================================
--- KoColorSpaceRegistry.cpp	(Revision 1039072)
+++ KoColorSpaceRegistry.cpp	(Arbeitskopie)
@@ -160,15 +160,12 @@
 
 KoColorSpaceRegistry::~KoColorSpaceRegistry()
 {
-    d->alphaCs->d->ownedByRegistry = false;
-
     delete d->colorConversionSystem;
     foreach( KoColorProfile* profile, d->profileMap) {
         delete profile;
     }
     d->profileMap.clear();
     foreach( const KoColorSpace * cs, d->csMap) {
-        cs->d->ownedByRegistry = false;
         delete cs;
     }
     d->csMap.clear();
Index: KoColorSpace.cpp
===================================================================
--- KoColorSpace.cpp	(Revision 1039113)
+++ KoColorSpace.cpp	(Arbeitskopie)
@@ -60,15 +60,17 @@
 
 KoColorSpace::~KoColorSpace()
 {
-    Q_ASSERT(!d->ownedByRegistry);
     qDeleteAll(d->compositeOps);
     foreach(KoChannelInfo * channel, d->channels)
     {
         delete channel;
     }
-    KoColorConversionCache* cache = KoColorSpaceRegistry::instance()->colorConversionCache();
-    if (cache) {
-        cache->colorSpaceIsDestroyed(this);
+    // conversions of colorspaces owned by the registry will be deleted once the cache gets deleted
+    if(!d->ownedByRegistry) {
+        KoColorConversionCache* cache = KoColorSpaceRegistry::instance()->colorConversionCache();
+        if (cache) {
+            cache->colorSpaceIsDestroyed(this);
+        }
     }
     delete d->mixColorsOp;
     delete d->convolutionOp;


_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


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

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