浏览代码

sched: Always call on_channel_free() regardless of state

A channel can bounce in the scheduler and bounce out with the IDLE state which
means that if it came in the scheduler once, it has socket information that
needs to be freed from the global hash table.

Signed-off-by: David Goulet <dgoulet@torproject.org>
David Goulet 6 年之前
父节点
当前提交
84d18f70f3
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/or/scheduler.c

+ 3 - 3
src/or/scheduler.c

@@ -547,11 +547,11 @@ scheduler_release_channel,(channel_t *chan))
                               offsetof(channel_t, sched_heap_idx),
                               chan);
     }
-    if (the_scheduler->on_channel_free) {
-      the_scheduler->on_channel_free(chan);
-    }
   }
 
+  if (the_scheduler->on_channel_free) {
+    the_scheduler->on_channel_free(chan);
+  }
   chan->scheduler_state = SCHED_CHAN_IDLE;
 }