From 7e1a122599e6d0933d04c8750353d4ae37585891 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 2 Jun 2002 17:44:20 +0000 Subject: [PATCH] Some sanity checking for when the element was removed from the pipeline. Original commit message from CVS: Some sanity checking for when the element was removed from the pipeline. --- gst/schedulers/gstbasicscheduler.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gst/schedulers/gstbasicscheduler.c b/gst/schedulers/gstbasicscheduler.c index 79faea4688..f42838d77a 100644 --- a/gst/schedulers/gstbasicscheduler.c +++ b/gst/schedulers/gstbasicscheduler.c @@ -324,9 +324,12 @@ gst_basic_scheduler_chain_wrapper (int argc, char *argv[]) /* due to oddities in the cothreads code, when this function returns it will * switch to the main cothread. thus, we need to unlock the current element. */ - if (SCHED (element)->current->post_run_func) - SCHED (element)->current->post_run_func (SCHED (element)->current); - SCHED (element)->current = NULL; + if (SCHED (element)) { + if (SCHED (element)->current && SCHED (element)->current->post_run_func) { + SCHED (element)->current->post_run_func (SCHED (element)->current); + } + SCHED (element)->current = NULL; + } GST_DEBUG_LEAVE ("(%d,'%s')", argc, name); gst_object_unref (GST_OBJECT (element));