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

List:       kde-commits
Subject:    [amarok] src/core-impl/collections/umscollection: Fix crash when remounting UMS.
From:       Bart Cerneels <bart.cerneels () kde ! org>
Date:       2012-01-25 9:06:16
Message-ID: 20120125090616.0AF23A60B9 () git ! kde ! org
[Download RAW message or body]

Git commit 4abcbc2fcc88f6902e127e6d19c89e007c31f157 by Bart Cerneels.
Committed on 25/01/2012 at 08:57.
Pushed by shanachie into branch 'master'.

Fix crash when remounting UMS.

Fix crash when a device holding a UmsCollection is mounted again after an unmount \
without removing the device in between. The crash occours because the QSharedPointer \
m_mc is cleared during an unmount but not initialized when mounted again. I fixed \
this issue by initializing m_mc in the init-method and not in the constructor.

Patch by Volker Christian

BUG:289751
FIXED-IN:2.6

REVIEW:103774

M  +3    -1    src/core-impl/collections/umscollection/UmsCollection.cpp

http://commits.kde.org/amarok/4abcbc2fcc88f6902e127e6d19c89e007c31f157

diff --git a/src/core-impl/collections/umscollection/UmsCollection.cpp \
b/src/core-impl/collections/umscollection/UmsCollection.cpp index df3445f..d39be23 \
                100644
--- a/src/core-impl/collections/umscollection/UmsCollection.cpp
+++ b/src/core-impl/collections/umscollection/UmsCollection.cpp
@@ -146,7 +146,7 @@ QString UmsCollection::s_collectionName( "collection_name" );
 UmsCollection::UmsCollection( Solid::Device device )
     : Collection()
     , m_device( device )
-    , m_mc( new MemoryCollection() )
+    , m_mc( 0 )
     , m_initialized( false )
     , m_autoConnect( false )
     , m_musicFilenameScheme( "%artist%/%album%/%track% %title%" )
@@ -285,6 +285,8 @@ UmsCollection::init()
         }
     }
 
+    m_mc =  QSharedPointer<MemoryCollection>(new MemoryCollection());
+
     m_initialized = true;
 
     if( m_autoConnect )


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

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