From 5b60aefc8b1ce7970b381a9559aadaeb40baaa6f Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Wed, 22 Mar 2017 19:02:19 -0500 Subject: [PATCH] Hack to stop thread --- src/siadrive_dokan_api/siadokandrive.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/siadrive_dokan_api/siadokandrive.cpp b/src/siadrive_dokan_api/siadokandrive.cpp index f26bc55..1df61bd 100644 --- a/src/siadrive_dokan_api/siadokandrive.cpp +++ b/src/siadrive_dokan_api/siadokandrive.cpp @@ -893,7 +893,6 @@ public: _uploadManager.reset(new CUploadManager(CSiaCurl(_siaApi->GetHostConfig()), _siaDriveConfig)); _dokanOptions.MountPoint = _mountPoint.ToUpper().str().c_str(); _mountStatus = DokanMain(&_dokanOptions, &_dokanOps); - OutputDebugString(std::to_wstring(_mountStatus).c_str()); })); } } @@ -904,6 +903,8 @@ public: { while (!DokanRemoveMountPoint(&_mountPoint[0])) ::Sleep(1000); + // HACK - DokanMain() never returns + ::TerminateThread(_mountThread->native_handle(), -1); _mountThread->join(); _mountThread.reset(nullptr); _mountPoint = "";