Destroy cothreads first before destroying context
authorWim Taymans <wim.taymans@gmail.com>
Fri, 20 Dec 2002 18:49:17 +0000 (18:49 +0000)
committerWim Taymans <wim.taymans@gmail.com>
Fri, 20 Dec 2002 18:49:17 +0000 (18:49 +0000)
Original commit message from CVS:
Destroy cothreads first before destroying context

gst/schedulers/gstoptimalscheduler.c

index 75c31d2..b2330f2 100644 (file)
@@ -1078,6 +1078,20 @@ gst_opt_scheduler_reset (GstScheduler *sched)
 { 
 #ifdef USE_COTHREADS
   GstOptScheduler *osched = GST_OPT_SCHEDULER_CAST (sched);
+  GSList *chains = osched->chains;
+
+  while (chains) {
+    GstOptSchedulerChain *chain = (GstOptSchedulerChain *) chains->data;
+    GSList *groups = chain->groups;
+
+    while (groups) {
+      GstOptSchedulerGroup *group = (GstOptSchedulerGroup *) groups->data;
+
+      destroy_group_scheduler (group);
+      groups = groups->next;
+    }
+    chains = chains->next;
+  }
              
   if (osched->context) {
     do_cothread_context_destroy (osched->context);