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

Unified Diff: src/ConsoleJsObject.cpp

Issue 10310030: Convert references to FileSystem & Co. into shared pointers (avoid use after free) (Closed)
Patch Set: Created April 18, 2013, 11:59 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
Index: src/ConsoleJsObject.cpp
===================================================================
--- a/src/ConsoleJsObject.cpp
+++ b/src/ConsoleJsObject.cpp
@@ -12,17 +12,18 @@ namespace
AdblockPlus::JsEngine& jsEngine = AdblockPlus::JsEngine::FromArguments(arguments);
const AdblockPlus::JsEngine::Context context(jsEngine);
AdblockPlus::JsValueList converted = jsEngine.ConvertArguments(arguments);
std::stringstream message;
for (size_t i = 0; i < converted.size(); i++)
message << converted[i]->AsString();
- (jsEngine.GetErrorCallback())(message.str());
+ AdblockPlus::ErrorCallbackPtr callback = jsEngine.GetErrorCallback();
+ (*callback)(message.str());
return v8::Undefined();
}
v8::Handle<v8::Value> TraceCallback(const v8::Arguments& arguments)
{
return v8::Undefined();
}
}
« no previous file with comments | « shell/src/Main.cpp ('k') | src/DefaultErrorCallback.cpp » ('j') | src/JsEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld