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

List:       kde-commits
Subject:    [Amarok]  Fix crash on exit where after reading a UMS device
From:       Alejandro Wainzinger <aikawarazuni () gmail ! com>
Date:       2010-01-06 18:54:01
Message-ID: 201001061854.o06Is19d021621 () Wurst ! kollide ! net
[Download RAW message or body]

commit cbdc1ffa88eee9a2f0b94558545bf0b2e2daf45e
Author:     Alejandro Wainzinger <aikawarazuni@gmail.com>
AuthorDate: Wed Jan 6 10:43:25 2010 -0800
Commit:     Alejandro Wainzinger <aikawarazuni@gmail.com>
CommitDate: Wed Jan 6 10:43:25 2010 -0800

    Fix crash on exit where after reading a UMS device and exiting, a double-listed \
collection tries to get double-deleted.  Also fixes potential future issues with \
collections double-listed.

diff --git a/src/collection/CollectionManager.cpp \
b/src/collection/CollectionManager.cpp index 8cefe49..2a5a9e2 100644
--- a/src/collection/CollectionManager.cpp
+++ b/src/collection/CollectionManager.cpp
@@ -13,7 +13,7 @@
  * You should have received a copy of the GNU General Public License along with      \
                *
  * this program.  If not, see <http://www.gnu.org/licenses/>.                        \
                *
  ****************************************************************************************/
                
- 
+
 #define DEBUG_PREFIX "CollectionManager"
 
 #include "CollectionManager.h"
@@ -246,11 +246,21 @@ CollectionManager::queryMaker() const
 void
 CollectionManager::slotNewCollection( Amarok::Collection* newCollection )
 {
+    DEBUG_BLOCK
     if( !newCollection )
     {
         debug() << "Warning, newCollection in slotNewCollection is 0";
         return;
     }
+    foreach( CollectionPair p, d->collections )
+    {
+        if( p.first == newCollection )
+        {
+            debug() << "Warning, newCollection is already being managed";
+            return;
+        }
+    }
+
     const QMetaObject *mo = metaObject();
     const QMetaEnum me = mo->enumerator( mo->indexOfEnumerator( "CollectionStatus" ) \
                );
     const QString &value = KGlobal::config()->group( "CollectionManager" \
).readEntry( newCollection->collectionId() );


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

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