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

Unified 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.
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 | « shell/src/GcCommand.h ('k') | shell/src/Main.cpp » ('j') | src/JsEngine.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/src/GcCommand.cpp
===================================================================
--- a/shell/src/GcCommand.cpp
+++ b/shell/src/GcCommand.cpp
@@ -1,18 +1,18 @@
#include "GcCommand.h"
-GcCommand::GcCommand(AdblockPlus::JsEngine& jsEngine)
+GcCommand::GcCommand(AdblockPlus::JsEnginePtr jsEngine)
: Command("gc"), jsEngine(jsEngine)
{
}
void GcCommand::operator()(const std::string& arguments)
{
- jsEngine.Gc();
+ jsEngine->Gc();
}
std::string GcCommand::GetDescription() const
{
return "Initiates a garbage collection";
}
std::string GcCommand::GetUsage() const
« 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