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

Unified Diff: shell/src/Main.cpp

Issue 10173031: Don`t use references to JsEngine to avoid use-after-free errors,switch to shared_ptr instead (Closed)
Patch Set: Created April 18, 2013, 4:15 p.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
Index: shell/src/Main.cpp
===================================================================
--- a/shell/src/Main.cpp
+++ b/shell/src/Main.cpp
@@ -35,17 +35,17 @@ namespace
int main()
{
try
{
AdblockPlus::AppInfo appInfo;
appInfo.version = "1.0";
appInfo.name = "Adblock Plus Shell";
- AdblockPlus::JsEngine jsEngine(appInfo);
+ AdblockPlus::JsEnginePtr jsEngine(AdblockPlus::JsEngine::New(appInfo));
AdblockPlus::FilterEngine filterEngine(jsEngine);
CommandMap commands;
Add(commands, new GcCommand(jsEngine));
Add(commands, new HelpCommand(commands));
Add(commands, new FiltersCommand(filterEngine));
Add(commands, new SubscriptionsCommand(filterEngine));
Add(commands, new MatchesCommand(filterEngine));
« no previous file with comments | « shell/src/GcCommand.cpp ('k') | src/AppInfoJsObject.h » ('j') | src/JsEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld