diff data/fileio/test/EncodingTest.h @ 1402:aadfb395e933

Fix some one-off memory leaks (including distracting ones in tests)
author Chris Cannam
date Mon, 06 Mar 2017 17:37:23 +0000
parents 8eddb528ef0c
children 87ae75da6527
line wrap: on
line diff
--- a/data/fileio/test/EncodingTest.h	Mon Mar 06 17:23:46 2017 +0000
+++ b/data/fileio/test/EncodingTest.h	Mon Mar 06 17:37:23 2017 +0000
@@ -107,6 +107,8 @@
             (encodingDir + "/" + audiofile, params);
 
         QVERIFY(reader != nullptr);
+
+        delete reader;
     }
 
     void readMetadata_data() {
@@ -132,7 +134,13 @@
         QString file = fileAndExt[0];
         QString extension = fileAndExt[1];
 
-        if (extension != "wav") {
+        if (extension == "wav") {
+
+            // Nothing
+            
+            delete reader;
+
+        } else {
 
 #if (!defined (HAVE_OGGZ) || !defined(HAVE_FISHSOUND))
             if (extension == "ogg") {
@@ -145,6 +153,8 @@
             QString title = reader->getTitle();
             QVERIFY(title != QString());
 
+            delete reader;
+
             bool found = false;
             for (int m = 0; m < mappingCount; ++m) {
                 if (file == QString::fromUtf8(mapping[m][0])) {