element: Enforce that elements created by gst_element_factory_create/make() are floating
[platform/upstream/gstreamer.git] / gst / gst.c
index fc4f253..2f4c789 100644 (file)
--- a/gst/gst.c
+++ b/gst/gst.c
@@ -237,7 +237,7 @@ DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
  * threading system as one of the very first things in your program
  * (see the example at the beginning of this section).
  *
- * Returns: (transfer full): a pointer to GStreamer's option group.
+ * Returns: (transfer full) (nullable): a pointer to GStreamer's option group.
  */
 
 GOptionGroup *
@@ -375,7 +375,7 @@ find_executable_path (void)
  * external process, the returned path will be the same as from the
  * parent process.
  *
- * Returns: (transfer none): The path of the executable that
+ * Returns: (transfer none) (nullable): The path of the executable that
  *   initialized GStreamer, or %NULL if it could not be determined.
  *
  * Since: 1.14
@@ -633,7 +633,7 @@ gst_register_core_elements (GstPlugin * plugin)
 
 /*
  * this bit handles:
- * - initalization of threads if we use them
+ * - initialization of threads if we use them
  * - log handler
  * - initial output
  * - initializes gst_format
@@ -1077,6 +1077,9 @@ gst_deinit (void)
   GstBinClass *bin_class;
   GstClock *clock;
 
+  if (!gst_initialized)
+    return;
+
   GST_INFO ("deinitializing GStreamer");
 
   if (gst_deinitialized) {
@@ -1084,7 +1087,7 @@ gst_deinit (void)
     return;
   }
   g_thread_pool_set_max_unused_threads (0);
-  bin_class = GST_BIN_CLASS (g_type_class_peek (gst_bin_get_type ()));
+  bin_class = (GstBinClass *) g_type_class_peek (gst_bin_get_type ());
   if (bin_class && bin_class->pool != NULL) {
     g_thread_pool_free (bin_class->pool, FALSE, TRUE);
     bin_class->pool = NULL;
@@ -1122,6 +1125,7 @@ gst_deinit (void)
 
   _priv_gst_caps_features_cleanup ();
   _priv_gst_caps_cleanup ();
+  _priv_gst_debug_cleanup ();
 
   g_type_class_unref (g_type_class_peek (gst_object_get_type ()));
   g_type_class_unref (g_type_class_peek (gst_pad_get_type ()));