tests: camerabin: improve preview handling in tests
authorThiago Santos <ts.santos@sisa.samsung.com>
Thu, 30 Jan 2014 06:28:45 +0000 (03:28 -0300)
committerThiago Santos <ts.santos@sisa.samsung.com>
Thu, 30 Jan 2014 06:29:25 +0000 (03:29 -0300)
Always erase the preview image data to allow the next check for
it to operate properly

tests/check/elements/camerabin.c

index 86afed28db6eef011966830e07749b55efb648e8..206987f35c290cc1fb3e0811aa248c163b1cede6 100644 (file)
@@ -360,6 +360,13 @@ check_preview_image (GstElement * camera, const gchar * filename, gint index)
             preview_caps));
   }
   g_free (prev_filename);
+
+  /* clean up preview info for next capture */
+  g_free (preview_filename);
+  preview_filename = NULL;
+  if (preview_sample)
+    gst_sample_unref (preview_sample);
+  preview_sample = NULL;
 }
 
 static void