From 3df07cbc88c2e2451766baca7a1c7c3c4d7b6b50 Mon Sep 17 00:00:00 2001 From: Kenfe-Mickael Laventure Date: Thu, 20 Jul 2017 09:08:28 +0200 Subject: [PATCH] Cancel io if task is deleted without being started This prevent a deadlock on Windows since no process is actually running until `Start()` is called. Signed-off-by: Kenfe-Mickael Laventure --- task.go | 1 + 1 file changed, 1 insertion(+) diff --git a/task.go b/task.go index a780ed8bd..61191d312 100644 --- a/task.go +++ b/task.go @@ -188,6 +188,7 @@ func (t *task) Wait(ctx context.Context) (uint32, error) { // during cleanup func (t *task) Delete(ctx context.Context) (uint32, error) { if t.io != nil { + t.io.Cancel() t.io.Wait() t.io.Close() }