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

List:       kde-commits
Subject:    KDE/kdemultimedia
From:       Will Stephenson <lists () stevello ! free-online ! co ! uk>
Date:       2005-08-19 13:08:23
Message-ID: 1124456903.701822.18891.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 450904 by wstephens:

Forward port fix for double deletion segfault when cd changes while cddb
entry selection dialog is shown.


 M  +6 -0      kaudiocreator/tracksimp.cpp  
 M  +5 -2      libkcddb/client.cpp  


--- trunk/KDE/kdemultimedia/kaudiocreator/tracksimp.cpp #450903:450904
@@ -258,6 +258,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;
@@ -293,6 +294,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
--- trunk/KDE/kdemultimedia/libkcddb/client.cpp #450903:450904
@@ -215,8 +215,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


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

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