From 2dc13fd9643d056a83df4c3a64987b52208fd8e4 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 5 Oct 2017 23:36:05 +0200 Subject: [PATCH] plugin-manager: allow multiple calls to port_context_complete() Only the first one will work. --- src/mm-plugin-manager.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mm-plugin-manager.c b/src/mm-plugin-manager.c index 7dd7ce83..dee96184 100644 --- a/src/mm-plugin-manager.c +++ b/src/mm-plugin-manager.c @@ -255,8 +255,11 @@ port_context_complete (PortContext *port_context) { GTask *task; - /* Steal the task from the task */ - g_assert (port_context->task); + /* If already completed, do nothing */ + if (!port_context->task) + return; + + /* Steal the task from the context, we only will complete once */ task = port_context->task; port_context->task = NULL;