SVN commit 450902 by wstephens: Backport fix for double deletion segfault on cd change while showing entry selection dialog. M +6 -0 kaudiocreator/tracksimp.cpp M +5 -2 libkcddb/client.cpp --- branches/KDE/3.4/kdemultimedia/kaudiocreator/tracksimp.cpp #450901:450902 @@ -291,6 +291,7 @@ // TODO Why doesn't libcddb not return MultipleRecordFound? //if( result == KCDDB::CDDB::MultipleRecordFound ) { if( Prefs::promptIfIncompleteInfo() && cddb->lookupResponse().count() > 1 ) { + QString searchedCDId = cddbInfo.id; CDInfoList cddb_info = cddb->lookupResponse(); CDInfoList::iterator it; QStringList list; @@ -326,6 +327,11 @@ return; // user pressed Cancel } + // Check that the CD we looked up is the one now loaded. + // The user might have ejected the CD while we were in the + // KInputDialog event loop, and replaced it with another one. + if ( searchedCDId != cddbInfo.id ) + return; } // Some sanity provisions to ensure that the number of records matches what --- branches/KDE/3.4/kdemultimedia/libkcddb/client.cpp #450901:450902 @@ -216,8 +216,11 @@ emit finished( r ); - cdInfoLookup->deleteLater(); - cdInfoLookup = 0L; + if ( cdInfoLookup ) // in case someone called lookup() while finished() was being processed, and deleted cdInfoLookup. + { + cdInfoLookup->deleteLater(); + cdInfoLookup = 0L; + } } void