[cheese/wip/fixes: 6/9] Fix memory leak when creating a new CheeseCamera
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese/wip/fixes: 6/9] Fix memory leak when creating a new CheeseCamera
- Date: Wed, 6 Nov 2013 12:07:30 +0000 (UTC)
commit 0e739a64f78246af2afc9a74155ac47fce756e51
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]