[cheese] Fix memory leak when freeing video formats



commit d55e6732315744725b5afa2b90c8c693ec93d5ee
Author: Hans de Goede <hdegoede redhat com>
Date:   Thu Jun 13 14:18:52 2013 +0200

    Fix memory leak when freeing video formats
    
    Free the GList, as well as the video formats in the list.
    
    Signed-off-by: Hans de Goede <hdegoede redhat com>

 libcheese/cheese-camera-device.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/libcheese/cheese-camera-device.c b/libcheese/cheese-camera-device.c
index 0ac5b59..580ec4b 100644
--- a/libcheese/cheese-camera-device.c
+++ b/libcheese/cheese-camera-device.c
@@ -384,12 +384,11 @@ cheese_camera_device_add_format (CheeseCameraDevice *device,
 /*
  * free_format_list_foreach:
  * @data: the #CheeseVideoFormatFull to free
- * @user_data: unused
  *
  * Free the individual #CheeseVideoFormatFull.
  */
 static void
-free_format_list_foreach (gpointer data, G_GNUC_UNUSED gpointer user_data)
+free_format_list_foreach (gpointer data)
 {
   g_slice_free (CheeseVideoFormatFull, data);
 }
@@ -405,7 +404,7 @@ free_format_list (CheeseCameraDevice *device)
 {
   CheeseCameraDevicePrivate *priv = device->priv;
 
-  g_list_foreach (priv->formats, free_format_list_foreach, NULL);
+  g_list_free_full (priv->formats, free_format_list_foreach);
   priv->formats = NULL;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]