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

List:       kde-commits
Subject:    branches/KDE/3.5/kdelibs/kio/kio
From:       Aaron J. Seigo <aseigo () kde ! org>
Date:       2005-11-09 22:09:07
Message-ID: 1131574147.994499.20052.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 479280 by aseigo:

in kicker when we have items in the menu that use dirlister, they get
deleted at a point when the dirlister has had its holders removed so
calls to forgetDirs fail. so instead of using ASSERTS we just check for
the pointers instead of assert()ing them and voila! the kdirlister crash is gone! huzzah!
BUG:113242


 M  +7 -5      kdirlister.cpp  


--- branches/KDE/3.5/kdelibs/kio/kio/kdirlister.cpp #479279:479280
@@ -415,8 +415,11 @@
   url.adjustPath( -1 );
   QString urlStr = url.url();
   QPtrList<KDirLister> *holders = urlsCurrentlyHeld[urlStr];
-  Q_ASSERT( holders );
-  holders->removeRef( lister );
+  //Q_ASSERT( holders );
+  if ( holders )
+  {
+    holders->removeRef( lister );
+  }
 
   // remove the dir from lister->d->lstDirs so that it doesn't contain things
   // that itemsInUse doesn't. When emitting the canceled signals lstDirs must
@@ -425,9 +428,8 @@
   lister->d->lstDirs.remove( lister->d->lstDirs.find( url ) );
 
   DirItem *item = itemsInUse[urlStr];
-  Q_ASSERT( item );
 
-  if ( holders->isEmpty() )
+  if ( holders && holders->isEmpty() )
   {
     urlsCurrentlyHeld.remove( urlStr ); // this deletes the (empty) holders list
     if ( !urlsCurrentlyListed[urlStr] )
@@ -454,7 +456,7 @@
       if ( notify )
         emit lister->clear( url );
 
-      if ( item->complete )
+      if ( item && item->complete )
       {
         kdDebug(7004) << k_funcinfo << lister << " item moved into cache: " << url << endl;
         itemsCached.insert( urlStr, item ); // TODO: may return false!!
[prev in list] [next in list] [prev in thread] [next in thread] 

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