imagingext_pub/exif_api/tsrc/src/ExifReadTest.cpp
changeset 27 b0bc8115cfe9
parent 0 469c91dae73b
--- a/imagingext_pub/exif_api/tsrc/src/ExifReadTest.cpp	Tue Sep 14 16:30:15 2010 +0300
+++ b/imagingext_pub/exif_api/tsrc/src/ExifReadTest.cpp	Wed Oct 13 13:10:46 2010 +0300
@@ -26,7 +26,10 @@
 	CleanupStack::PushL(exif);
 	CExifRead* read = CExifRead::NewL(*exif);
 	if(!read)
+	    {
+        delete read;
 		User::Leave(KErrGeneral);
+        }
 	delete read;
 	CleanupStack::PopAndDestroy(exif);
 	}
@@ -1454,9 +1457,9 @@
 
 	RDebug::Print(_L("Instantiate CExifRead..."));
 	CExifRead* read = CExifRead::NewL(*exif);
+	CleanupStack::PushL(read);
 	if(!read)
 		User::Leave(KErrGeneral);
-	CleanupStack::PushL(read);
 	
 	RDebug::Print(_L("Read thumbnail..."));
 	HBufC8* thumbnail = read->GetThumbnailL();
@@ -1478,9 +1481,9 @@
 
 	RDebug::Print(_L("Instantiate CExifRead no jpeg..."));
 	read = CExifRead::NewL(*exif, CExifRead::ENoJpeg);
+	CleanupStack::PushL(read);
 	if(!read)
 		User::Leave(KErrGeneral);
-	CleanupStack::PushL(read);
 	
 	RDebug::Print(_L("Read thumbnail..."));
 	thumbnail = read->GetThumbnailL();
@@ -1501,9 +1504,9 @@
 
 	RDebug::Print(_L("Instantiate CExifRead..."));
 	read = CExifRead::NewL(*exif);
+	CleanupStack::PushL(read);
 	if(!read)
 		User::Leave(KErrGeneral);
-	CleanupStack::PushL(read);
 	
 	RDebug::Print(_L("Read thumbnail..."));
 	thumbnail = read->GetThumbnailL();
@@ -1524,9 +1527,9 @@
 
 	RDebug::Print(_L("Instantiate CExifRead no jpeg..."));
 	read = CExifRead::NewL(*exif, CExifRead::ENoJpeg);
+	CleanupStack::PushL(read);
 	if(!read)
 		User::Leave(KErrGeneral);
-	CleanupStack::PushL(read);
 	
 	RDebug::Print(_L("Read thumbnail..."));
 	thumbnail = read->GetThumbnailL();
@@ -1555,9 +1558,9 @@
 
 	RDebug::Print(_L("Instantiate CExifRead and ignore unknown/missing tags..."));
 	CExifRead* read = CExifRead::NewL(*exif, CExifRead::ENoTagChecking);
+	CleanupStack::PushL(read);
 	if(!read)
 		User::Leave(KErrGeneral);
-	CleanupStack::PushL(read);
 	
 	RDebug::Print(_L("Read thumbnail..."));
 	HBufC8* thumbnail = read->GetThumbnailL();
@@ -1598,9 +1601,9 @@
 
 	RDebug::Print(_L("Instantiate CExifRead and ignore unknown/missing tags..."));
 	read = CExifRead::NewL(*exif, CExifRead::ENoTagChecking);
+	CleanupStack::PushL(read);
 	if(!read)
 		User::Leave(KErrGeneral);
-	CleanupStack::PushL(read);
 	
 	RDebug::Print(_L("Read thumbnail..."));
 	thumbnail = read->GetThumbnailL();
@@ -1641,9 +1644,9 @@
 
 	RDebug::Print(_L("Instantiate CExifRead and ignore unknown/missing tags..."));
 	read = CExifRead::NewL(*exif, CExifRead::ENoTagChecking);
+	CleanupStack::PushL(read);
 	if(!read)
 		User::Leave(KErrGeneral);
-	CleanupStack::PushL(read);
 	
 	RDebug::Print(_L("Read thumbnail..."));
 	thumbnail = read->GetThumbnailL();