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

Side by Side Diff: shell/src/GcCommand.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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "GcCommand.h" 1 #include "GcCommand.h"
2 2
3 GcCommand::GcCommand(AdblockPlus::JsEngine& jsEngine) 3 GcCommand::GcCommand(AdblockPlus::JsEnginePtr jsEngine)
4 : Command("gc"), jsEngine(jsEngine) 4 : Command("gc"), jsEngine(jsEngine)
5 { 5 {
6 } 6 }
7 7
8 void GcCommand::operator()(const std::string& arguments) 8 void GcCommand::operator()(const std::string& arguments)
9 { 9 {
10 jsEngine.Gc(); 10 jsEngine->Gc();
11 } 11 }
12 12
13 std::string GcCommand::GetDescription() const 13 std::string GcCommand::GetDescription() const
14 { 14 {
15 return "Initiates a garbage collection"; 15 return "Initiates a garbage collection";
16 } 16 }
17 17
18 std::string GcCommand::GetUsage() const 18 std::string GcCommand::GetUsage() const
19 { 19 {
20 return name; 20 return name;
21 } 21 }
OLDNEW
« no previous file with comments | « shell/src/GcCommand.h ('k') | shell/src/Main.cpp » ('j') | src/JsEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld