Small cleanups and leak fixes

Original commit message from CVS:
Small cleanups and leak fixes
This commit is contained in:
Wim Taymans 2002-09-15 13:45:26 +00:00
parent 277726f4a1
commit c2e64f65da
6 changed files with 14 additions and 2 deletions

View file

@ -839,6 +839,8 @@ gst_fakesrc_change_state (GstElement *element)
gst_buffer_pool_unref (fakesrc->pool);
fakesrc->pool = NULL;
}
if (fakesrc->last_message)
g_free (fakesrc->last_message);
break;
default:
g_assert_not_reached ();

View file

@ -190,8 +190,11 @@ gst_init_with_popt_table (int *argc, char **argv[], const struct poptOption *pop
poptBadOption (context, 0),
poptStrerror (nextopt),
(*argv)[0]);
poptFreeContext (context);
exit (1);
}
poptFreeContext (context);
/* let's do this once there are 1.6.3 popt debs out
*argc = poptStrippedArgv (context, *argc, *argv); */
@ -600,6 +603,7 @@ gst_main_quit (void)
GMainLoop *loop = mainloops->data;
mainloops = g_slist_delete_link (mainloops, mainloops);
g_main_loop_quit (loop);
g_main_loop_unref (loop);
}
}

View file

@ -99,7 +99,8 @@ gst_data_copy (const GstData *data)
* Copies the given #GstData if the refcount is greater than 1 so that the
* #GstData object can be written to safely.
*
* Returns: a copy of the data if the refcount is > 1, data if the refcount == 1
* Returns: a copy of the data if the refcount is > 1 or the buffer is
* marked READONLY, data if the refcount == 1,
* or NULL if the data could not be copied. The refcount of the original buffer
* is decreased when a copy is made, so you are not supposed to use it after a
* call to this function.

View file

@ -144,7 +144,7 @@ gst_element_factory_new (const gchar *name, GType type,
{
GstElementFactory *factory;
g_return_val_if_fail(name != NULL, NULL);
g_return_val_if_fail (name != NULL, NULL);
g_return_val_if_fail (type, NULL);
g_return_val_if_fail (details, NULL);

View file

@ -608,6 +608,7 @@ gst_xml_registry_load (GstRegistry *registry)
g_timer_stop (timer);
seconds = g_timer_elapsed (timer, NULL);
g_timer_destroy (timer);
g_print ("registry: loaded %s in %f seconds\n (%s)\n",
registry->name, seconds, xmlregistry->location);
@ -1059,6 +1060,8 @@ gst_xml_registry_end_element (GMarkupParseContext *context,
xmlregistry->parser = gst_xml_registry_parse_padtemplate;
caps = gst_caps_new (xmlregistry->caps_name, xmlregistry->caps_mime, xmlregistry->props);
g_free (xmlregistry->caps_mime);
g_free (xmlregistry->caps_name);
xmlregistry->caps = gst_caps_append (xmlregistry->caps, caps);
xmlregistry->props = NULL;

View file

@ -839,6 +839,8 @@ gst_fakesrc_change_state (GstElement *element)
gst_buffer_pool_unref (fakesrc->pool);
fakesrc->pool = NULL;
}
if (fakesrc->last_message)
g_free (fakesrc->last_message);
break;
default:
g_assert_not_reached ();