Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/engine/main.cpp

Issue 10973008: Make tabs hang less (Closed)
Patch Set: Created June 13, 2013, 9:03 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/plugin/AdblockPlusClient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | src/plugin/AdblockPlusClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld