From d628988e0a0289fcad302c403f87c9b5128538b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 24 Jun 2009 09:28:01 +0100 Subject: [PATCH] make check: add check for enum type class unrefs in gst_deinit() too Just because we can really. --- Makefile.am | 15 +++++++++++++++ gst/gst.c | 9 +++++++++ 2 files changed, 24 insertions(+) diff --git a/Makefile.am b/Makefile.am index 5251d66..d15bc92 100644 --- a/Makefile.am +++ b/Makefile.am @@ -117,6 +117,21 @@ check-enum-gettypes: $(top_builddir)/gst/gstenumtypes.h echo " g_type_class_ref ($$f ());"; \ done; \ exit 1; \ + fi; \ + echo 'Checking if all enum and flag _get_type() funcs are deinited in gst_deinit()'; \ + MISSING_FUNCS=''; \ + for f in $$FUNCS; do \ + INIT_LINE=`grep $$f $(top_srcdir)/gst/*.c | grep g_type_class_unref`; \ + if test "x$$INIT_LINE" = "x"; then \ + MISSING_FUNCS="$$MISSING_FUNCS $$f"; \ + fi; \ + done; \ + if test "x$$MISSING_FUNCS" != "x"; then \ + echo "FIXME: please add to the following to gst/gst.c gst_deinit():"; \ + for f in $$MISSING_FUNCS; do \ + echo " g_type_class_unref (g_type_class_peek ($$f ()));"; \ + done; \ + exit 1; \ fi include $(top_srcdir)/common/coverage/lcov.mak diff --git a/gst/gst.c b/gst/gst.c index 21a6cb6..8905803 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -1379,9 +1379,11 @@ gst_deinit (void) g_type_class_unref (g_type_class_peek (gst_bin_flags_get_type ())); g_type_class_unref (g_type_class_peek (gst_buffer_flag_get_type ())); g_type_class_unref (g_type_class_peek (gst_buffer_copy_flags_get_type ())); + g_type_class_unref (g_type_class_peek (gst_buffer_list_item_get_type ())); g_type_class_unref (g_type_class_peek (gst_bus_flags_get_type ())); g_type_class_unref (g_type_class_peek (gst_bus_sync_reply_get_type ())); g_type_class_unref (g_type_class_peek (gst_caps_flags_get_type ())); + g_type_class_unref (g_type_class_peek (gst_clock_type_get_type ())); g_type_class_unref (g_type_class_peek (gst_clock_return_get_type ())); g_type_class_unref (g_type_class_peek (gst_clock_entry_type_get_type ())); g_type_class_unref (g_type_class_peek (gst_clock_flags_get_type ())); @@ -1392,8 +1394,15 @@ gst_deinit (void) g_type_class_unref (g_type_class_peek (gst_element_flags_get_type ())); g_type_class_unref (g_type_class_peek (gst_core_error_get_type ())); g_type_class_unref (g_type_class_peek (gst_library_error_get_type ())); + g_type_class_unref (g_type_class_peek (gst_plugin_dependency_flags_get_type + ())); + g_type_class_unref (g_type_class_peek (gst_parse_flags_get_type ())); g_type_class_unref (g_type_class_peek (gst_resource_error_get_type ())); + g_type_class_unref (g_type_class_peek (gst_search_mode_get_type ())); g_type_class_unref (g_type_class_peek (gst_stream_error_get_type ())); + g_type_class_unref (g_type_class_peek (gst_stream_status_type_get_type ())); + g_type_class_unref (g_type_class_peek (gst_structure_change_type_get_type + ())); g_type_class_unref (g_type_class_peek (gst_event_type_flags_get_type ())); g_type_class_unref (g_type_class_peek (gst_event_type_get_type ())); g_type_class_unref (g_type_class_peek (gst_seek_type_get_type ())); -- 2.7.4