[cheese/gnome-3-10] Fix memory leak when creating a new CheeseCamera



commit b696b667f73b398f57628c897dd79f14cd29151b
Author: David King <amigadave amigadave com>
Date:   Tue Nov 5 23:19:47 2013 +0000

    Fix memory leak when creating a new CheeseCamera

 libcheese/cheese-camera.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index ab5490d..8873194 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -1495,21 +1495,18 @@ cheese_camera_new (ClutterTexture *video_texture, const gchar *camera_device_nod
                    gint x_resolution, gint y_resolution)
 {
   CheeseCamera      *camera;
-  CheeseVideoFormat *format = g_slice_new (CheeseVideoFormat);
-
-  format->width  = x_resolution;
-  format->height = y_resolution;
+  CheeseVideoFormat format = { x_resolution, y_resolution };
 
   if (camera_device_node)
   {
     camera = g_object_new (CHEESE_TYPE_CAMERA, "video-texture", video_texture,
                            "device-node", camera_device_node,
-                           "format", format, NULL);
+                           "format", &format, NULL);
   }
   else
   {
     camera = g_object_new (CHEESE_TYPE_CAMERA, "video-texture", video_texture,
-                           "format", format, NULL);
+                           "format", &format, NULL);
   }
 
   return camera;


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