aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin-manager.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2017-10-05 23:36:05 +0200
committerAleksander Morgado <aleksander@aleksander.es>2017-10-05 23:46:42 +0200
commit2dc13fd9643d056a83df4c3a64987b52208fd8e4 (patch)
tree2decc8979991d782e7b5a0e4e99e5462440f9764 /src/mm-plugin-manager.c
parentbbe50645916c4596cf7c7b309aac267d396801b8 (diff)
plugin-manager: allow multiple calls to port_context_complete()
Only the first one will work.
Diffstat (limited to 'src/mm-plugin-manager.c')
-rw-r--r--src/mm-plugin-manager.c7
1 files 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;