summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.com>2015-02-17 20:47:23 +0000
committerTim-Philipp Müller <tim@centricular.com>2015-02-17 20:49:53 +0000
commit10f038d4fbe50cb5348107a51806dda3412c1ace (patch)
treec7fea69d79ec5fd837e8f536fcc266b627241105 /gst
parent4a757e651a964bb4d775d56e0712d3b6ac51bfab (diff)
message: revive async delivery message before bus thread can run unref
Revive message in dispose handler before we signal the bus thread, otherwise the bus thread might be woken up and unref the message before we had a chance to revive it yet.
Diffstat (limited to 'gst')
-rw-r--r--gst/gstmessage.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gst/gstmessage.c b/gst/gstmessage.c
index 9f4d286c0..51282b975 100644
--- a/gst/gstmessage.c
+++ b/gst/gstmessage.c
@@ -172,6 +172,9 @@ _gst_message_dispose (GstMessage * message)
gboolean do_free = TRUE;
if (GST_MINI_OBJECT_FLAG_IS_SET (message, GST_MESSAGE_FLAG_ASYNC_DELIVERY)) {
+ /* revive message, so bus can finish with it and clean it up */
+ gst_message_ref (message);
+
GST_INFO ("[msg %p] signalling async free", message);
GST_MESSAGE_LOCK (message);
@@ -179,7 +182,6 @@ _gst_message_dispose (GstMessage * message)
GST_MESSAGE_UNLOCK (message);
/* don't free it yet, let bus finish with it first */
- gst_message_ref (message);
do_free = FALSE;
}