From 94708b811f5f256300453588027fe54550236b6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Philippe=20Bruy=C3=A8re?= Date: Mon, 28 Aug 2017 05:00:12 +0200 Subject: [PATCH] prevent canceling thread multiple times causing a deadlock --- src/CrowThread.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/CrowThread.cs b/src/CrowThread.cs index 7e00d1b3..823fe1a6 100644 --- a/src/CrowThread.cs +++ b/src/CrowThread.cs @@ -53,11 +53,9 @@ namespace Crow } public void Start() { thread.Start();} public void Cancel(){ - if (thread.IsAlive){ + if (thread.IsAlive & !cancelRequested){ cancelRequested = true; - //cancelLoading = true; thread.Join (); - //cancelLoading = false; } lock (Host.currentInterface.CrowThreads) Host.currentInterface.CrowThreads.Remove (this); -- 2.47.3