make check: add check for enum type class unrefs in gst_deinit() too
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 24 Jun 2009 08:28:01 +0000 (09:28 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 24 Jun 2009 08:28:01 +0000 (09:28 +0100)
Just because we can really.

Makefile.am
gst/gst.c

index 5251d660f212334addb9fa06fc037879a3a93bb2..d15bc92653b3a2d617d851d9b288c0cb7543c6a1 100644 (file)
@@ -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
index 21a6cb6a19b30e8694cefa46d16007ef2ea68be7..89058034f47af527db6277df0c259f5f5843c90a 100644 (file)
--- 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 ()));