| Index: src/engine/main.cpp |
| =================================================================== |
| --- a/src/engine/main.cpp |
| +++ b/src/engine/main.cpp |
| @@ -207,14 +207,6 @@ |
| return 1; |
| } |
| - int argc; |
| - LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc); |
| - std::wstring locale(argc >= 2 ? argv[1] : L""); |
| - LocalFree(argv); |
| - |
| - Dictionary::Create(locale); |
| - filterEngine = CreateFilterEngine(locale); |
| - |
| for (;;) |
| { |
| try |
| @@ -222,6 +214,16 @@ |
| Communication::Pipe* pipe = new Communication::Pipe(Communication::pipeName, |
| Communication::Pipe::MODE_CREATE); |
| + if (!filterEngine.get()) |
| + { |
| + int argc; |
| + LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc); |
| + std::wstring locale(argc >= 2 ? argv[1] : L""); |
| + LocalFree(argv); |
| + Dictionary::Create(locale); |
| + filterEngine = CreateFilterEngine(locale); |
| + } |
| + |
| // TODO: Count established connections, kill the engine when none are left |
| AutoHandle thread(CreateThread(0, 0, ClientThread, static_cast<LPVOID>(pipe), 0, 0)); |
| if (!thread) |