From 6d3262a2ed9cc00b7c707961f28e77ea105d8af2 Mon Sep 17 00:00:00 2001 From: ronag Date: Tue, 16 Aug 2011 11:50:50 +0000 Subject: [PATCH] git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@1197 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- common/concurrency/com_context.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/common/concurrency/com_context.h b/common/concurrency/com_context.h index 8717d7e5c..31ab5a162 100644 --- a/common/concurrency/com_context.h +++ b/common/concurrency/com_context.h @@ -2,12 +2,15 @@ #include "executor.h" +#include "../log/log.h" + #define NOMINMAX #define WIN32_LEAN_AND_MEAN #include #include +#include #include @@ -28,11 +31,14 @@ public: ~com_context() { - executor::invoke([&] + if(!executor::begin_invoke([&] { instance_.reset(nullptr); ::CoUninitialize(); - }); + }).timed_wait(boost::posix_time::milliseconds(500))) + { + CASPAR_LOG(error) << L"[com_contex] Timer expired, deadlock detected and released, leaking resources"; + } } void reset(const std::function& factory = nullptr) -- 2.39.2