win32: fix the build break.

This commit is contained in:
Hermet Park 2016-08-26 17:17:25 +09:00
parent caa2a39d65
commit cf740c2ae1
1 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <Windows.h> #include <Windows.h>
static HANDLE hMutex = INVALID_HANDLE_VALUE; static HANDLE hMutex = NULL;
#endif #endif
typedef struct app_s typedef struct app_s
@ -952,7 +952,7 @@ enventor_lock_create(void)
{ {
#ifdef _WIN32 #ifdef _WIN32
hMutex = OpenMutex(MUTEX_ALL_ACCESS, 0, ENVENTOR_NAME); hMutex = OpenMutex(MUTEX_ALL_ACCESS, 0, ENVENTOR_NAME);
if (hMutex != INVALID_HANDLE_VALUE) if (hMutex)
{ {
fprintf(stdout, "Enventor program is already running!\n\n" fprintf(stdout, "Enventor program is already running!\n\n"
"If you are really stuck in launching enventor due to " "If you are really stuck in launching enventor due to "
@ -1001,10 +1001,10 @@ enventor_lock_remove()
if (!own_lock) return; if (!own_lock) return;
#ifdef _WIN32 #ifdef _WIN32
if (INVALID_HANDLE_VALUE != hMutex) if (hMutex)
{ {
Closehandle(hMutex); CloseHandle(hMutex);
hMutex = INVALID_HANDLE_VALUE; hMutex = NULL;
} }
#else #else
//Tempoary Folder //Tempoary Folder