glwindow: Fix memory leak of navigation thread
authorHaihua Hu <b55597@freescale.com>
Mon, 30 Nov 2015 01:36:09 +0000 (09:36 +0800)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:13 +0000 (19:32 +0000)
When stopping the navigation thread, call g_thread_join() to release
the resources hold by it.

https://bugzilla.gnome.org/show_bug.cgi?id=758820

gst-libs/gst/gl/gstglwindow.c

index 4971d50..90ea219 100644 (file)
@@ -337,6 +337,9 @@ gst_gl_window_finalize (GObject * object)
     while (window->nav_alive) {
       g_cond_wait (&window->nav_destroy_cond, &window->nav_lock);
     }
+    /* release resource hold by navigation thread */
+    g_thread_join(window->priv->navigation_thread);
+    window->priv->navigation_thread = NULL;
     g_mutex_unlock (&window->nav_lock);
   }