From 1843522b16e676cf94a957b62176ec395b02d775 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Fri, 10 Mar 2017 19:56:26 +0100 Subject: [PATCH] [Loader] Disable com environment during unit tests --- src/Components/Loader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Loader.cpp b/src/Components/Loader.cpp index 7a5025a1..066749f7 100644 --- a/src/Components/Loader.cpp +++ b/src/Components/Loader.cpp @@ -23,7 +23,7 @@ namespace Components Loader::Postgame = false; Loader::MemAllocator.clear(); - CoInitialize(nullptr); + if(!Loader::PerformingUnitTests()) CoInitialize(nullptr); Loader::Register(new Flags()); Loader::Register(new Singleton()); @@ -117,7 +117,7 @@ namespace Components Loader::Components.clear(); Loader::MemAllocator.clear(); - CoUninitialize(); + if (!Loader::PerformingUnitTests()) CoUninitialize(); } void Loader::PreDestroy()