Index: src/engine/main.cpp |
=================================================================== |
--- a/src/engine/main.cpp |
+++ b/src/engine/main.cpp |
@@ -187,7 +187,14 @@ |
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) |
{ |
- if (Communication::PipeExists(Communication::pipeName)) |
+ AutoHandle mutex(CreateMutexW(0, false, L"AdblockPlusEngine")); |
Oleksandr
2013/06/07 14:52:09
Shouldn't this be Global\AdblockPlusEngine?
|
+ if (!mutex) |
+ { |
+ DebugLastError("CreateMutex failed"); |
+ return 1; |
+ } |
+ |
+ if (GetLastError() == ERROR_ALREADY_EXISTS) |
{ |
DebugLastError("Named pipe exists, another engine instance appears to be running"); |
return 1; |