rtmp2: Replace explicit unref with g_main_context_invoke_full
authorJan Alexander Steffens (heftig) <jsteffens@make.tv>
Wed, 12 Feb 2020 15:49:45 +0000 (16:49 +0100)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 21 Feb 2020 15:20:41 +0000 (15:20 +0000)
gst/rtmp2/rtmp/rtmpconnection.c

index 1c6852a..dcb5d59 100644 (file)
@@ -856,7 +856,6 @@ start_write (gpointer user_data)
 {
   GstRtmpConnection *sc = user_data;
   gst_rtmp_connection_start_write (sc);
-  g_object_unref (sc);
   return G_SOURCE_REMOVE;
 }
 
@@ -904,7 +903,8 @@ gst_rtmp_connection_queue_message (GstRtmpConnection * self, GstBuffer * buffer)
   }
 
   g_async_queue_push (self->output_queue, g_byte_array_free_to_bytes (out_ba));
-  g_main_context_invoke (self->main_context, start_write, g_object_ref (self));
+  g_main_context_invoke_full (self->main_context, G_PRIORITY_DEFAULT,
+      start_write, g_object_ref (self), g_object_unref);
 }
 
 guint