From 1b685b0bb3a33b7b9eac254b4c4172903ef2eb38 Mon Sep 17 00:00:00 2001 From: Jose Fonseca Date: Wed, 17 Jun 2015 21:57:41 +0100 Subject: common: Use GetModuleHandle to detect WINE. Simpler and safer. --- common/highlight.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/highlight.cpp b/common/highlight.cpp index 6a1e783b..334ba57e 100644 --- a/common/highlight.cpp +++ b/common/highlight.cpp @@ -254,10 +254,9 @@ haveAnsi(void) } // http://wiki.winehq.org/DeveloperFaq#detect-wine - HMODULE hNtDll = LoadLibraryA("ntdll"); + HMODULE hNtDll = GetModuleHandleA("ntdll"); if (hNtDll) { result = GetProcAddress(hNtDll, "wine_get_version") != NULL; - FreeLibrary(hNtDll); } checked = true; -- cgit v1.2.3