internetradio2.0/favoritesdbsrc/irfavoritesdb.cpp
changeset 11 f683e24efca3
parent 8 3b03c28289e6
child 12 608f67c22514
--- a/internetradio2.0/favoritesdbsrc/irfavoritesdb.cpp	Fri Jun 11 13:30:40 2010 +0300
+++ b/internetradio2.0/favoritesdbsrc/irfavoritesdb.cpp	Wed Jun 23 18:04:00 2010 +0300
@@ -204,7 +204,7 @@
 	IRLOG_DEBUG( "CIRFavoritesDb::AddPresetL(des des int int)" );
 	iMoveStatus=EFalse;
     CIRIsdsPreset* saveItem;
-    saveItem = CIRIsdsPreset::NewL();
+    saveItem = CIRIsdsPreset::NewLC();
     saveItem->SetName(aName);
 	saveItem->SetUrlCount(1);//only one url is saved for manually added channel
 	saveItem->SetChannelType(EUserDefined);
@@ -212,7 +212,8 @@
 	//bitrate set to zero so that it is accessible to all kinds of bitrate settings
 	saveItem->SetUrlL(KNotAvailable,aURl,0);
 	AddPresetL(*saveItem,aReturn);
-	delete saveItem;
+	CleanupStack::PopAndDestroy(saveItem);
+
 	IRLOG_DEBUG( "CIRFavoritesDb::AddPresetL(des des int int) - Exiting." );
 	}