From f97d02375bc2a6411021b22d041274ee0fd271f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Cr=C3=AAte?= Date: Tue, 3 Nov 2009 18:33:35 -0500 Subject: [PATCH] shm: Make valgrind happy --- gst/shm/gstshmsink.c | 5 +++++ gst/shm/shmpipe.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gst/shm/gstshmsink.c b/gst/shm/gstshmsink.c index 2423512df1..b4f13b54e7 100644 --- a/gst/shm/gstshmsink.c +++ b/gst/shm/gstshmsink.c @@ -183,6 +183,8 @@ gst_shm_sink_finalize (GObject * object) GstShmSink *self = GST_SHM_SINK (object); g_cond_free (self->cond); + + G_OBJECT_CLASS (parent_class)->finalize (object); } /* @@ -275,6 +277,9 @@ gst_shm_sink_start (GstBaseSink * bsink) return FALSE; } + GST_DEBUG_OBJECT (self, "Creating new socket at %s" + " with shared memory of %d bytes", self->socket_path, self->size); + self->pipe = sp_writer_create (self->socket_path, self->size, self->perms); if (!self->pipe) { diff --git a/gst/shm/shmpipe.c b/gst/shm/shmpipe.c index 51aa8d4bf6..7a6156ce7e 100644 --- a/gst/shm/shmpipe.c +++ b/gst/shm/shmpipe.c @@ -409,7 +409,7 @@ sp_writer_resize (ShmPipe * self, size_t size) pathlen = strlen (newarea->shm_area_name) + 1; for (client = self->clients; client; client = client->next) { - struct CommandBuffer cb; + struct CommandBuffer cb = { 0 }; if (!send_command (client->fd, &cb, COMMAND_CLOSE_SHM_AREA, old_current->id)) @@ -504,7 +504,7 @@ sp_writer_send_buf (ShmPipe * self, gchar * buf, size_t size) sb->block = block; for (client = self->clients; client; client = client->next) { - struct CommandBuffer cb; + struct CommandBuffer cb = { 0 }; cb.payload.buffer.offset = offset; cb.payload.buffer.size = bsize; if (!send_command (client->fd, &cb, COMMAND_NEW_BUFFER, self->shm_area->id)) @@ -644,7 +644,7 @@ sp_client_recv_finish (ShmPipe * self, char *buf) { ShmArea *shm_area = NULL; unsigned long offset; - struct CommandBuffer cb; + struct CommandBuffer cb = { 0 }; for (shm_area = self->shm_area; shm_area; shm_area = shm_area->next) { if (buf >= shm_area->shm_area && @@ -695,7 +695,7 @@ sp_writer_accept_client (ShmPipe * self) { ShmClient *client = NULL; int fd; - struct CommandBuffer cb; + struct CommandBuffer cb = { 0 }; int pathlen = strlen (self->shm_area->shm_area_name) + 1;