This commit is contained in:
2025-02-27 11:42:37 +08:00
parent 8780f8555e
commit 6e4bf4a2c0

View File

@@ -12,6 +12,9 @@ func Pause(ctrl *common.CtrlWait) leaf.HandlerFunc {
return func(c *leaf.Context) { return func(c *leaf.Context) {
var cancel context.CancelFunc var cancel context.CancelFunc
// 保存原始的 Context
originalCtx := c.Context
// 获取锚点 // 获取锚点
holdPoint := c.Hold() holdPoint := c.Hold()
@@ -19,16 +22,8 @@ func Pause(ctrl *common.CtrlWait) leaf.HandlerFunc {
var wait sync.WaitGroup var wait sync.WaitGroup
defer wait.Wait() defer wait.Wait()
// 结束信号通道
a := make(chan struct{})
// 发送结束信号
defer close(a)
run := true run := true
// 保存原始的 Context
originalCtx := c.Context
wait.Add(1) wait.Add(1)
go func() { go func() {
defer wait.Done() defer wait.Done()