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

List:       kde-commits
Subject:    KDE/kdelibs/kdeui/icons
From:       David Faure <faure () kde ! org>
Date:       2007-01-08 23:08:10
Message-ID: 1168297690.061454.995.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 621529 by dfaure:

register iconloader from both constructors - otherwise all apps crash on exit


 M  +17 -8     kiconloader.cpp  


--- trunk/KDE/kdelibs/kdeui/icons/kiconloader.cpp #621528:621529
@@ -134,7 +134,7 @@
 // Keep a list of recently created and destroyed KIconLoader instances in order
 // to detect bugs like #68528.
 struct KIconLoaderDebug
-    {
+{
     KIconLoaderDebug( KIconLoader* l, const QString& a )
         : loader( l ), appname( a ), valid( true )
         {}
@@ -142,15 +142,12 @@
     QString appname;
     bool valid;
     QString delete_bt;
-    };
+};
 
 static QList< KIconLoaderDebug > *kiconloaders;
-#endif
 
-KIconLoader::KIconLoader(const QString& _appname, KStandardDirs *_dirs, QObject* parent)
-    : QObject(parent)
+static void registerIconLoader( KIconLoader* iconloader, const QString& _appname )
 {
-#ifdef KICONLOADER_CHECKS
     if( kiconloaders == NULL )
         kiconloaders = new QList< KIconLoaderDebug>();
     // check for the (very unlikely case) that new KIconLoader gets allocated
@@ -159,15 +156,24 @@
          it != kiconloaders->end();
          )
         {
-        if( (*it).loader == this )
+        if( (*it).loader == iconloader )
             it = kiconloaders->erase( it );
         else
             ++it;
         }
-    kiconloaders->append( KIconLoaderDebug( this, _appname ));
+    kiconloaders->append( KIconLoaderDebug( iconloader, _appname ));
+}
+
 #endif
+
+KIconLoader::KIconLoader(const QString& _appname, KStandardDirs *_dirs, QObject* parent)
+    : QObject(parent)
+{
     connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)),
             this, SLOT(newIconLoader()));
+#ifdef KICONLOADER_CHECKS
+    registerIconLoader(this, _appname);
+#endif
     init( _appname, _dirs );
 }
 
@@ -176,6 +182,9 @@
 {
     connect(KGlobalSettings::self(), SIGNAL(iconChanged(int)),
             this, SLOT(newIconLoader()));
+#ifdef KICONLOADER_CHECKS
+    registerIconLoader(this, instance->instanceName());
+#endif
     init( instance->instanceName(), instance->dirs() );
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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