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

Unified Diff: src/WebRequestJsObject.cpp

Issue 29361582: Issue 4613 - fix leak of Thread (Closed)
Patch Set: Created Nov. 3, 2016, 10:58 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
« src/Thread.cpp ('K') | « src/Thread.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/WebRequestJsObject.cpp
diff --git a/src/WebRequestJsObject.cpp b/src/WebRequestJsObject.cpp
index e44e82b55d598135d7c6dd5b5421780bd926193e..48a703709053895845a5bb83e4036158b9b094f9 100644
--- a/src/WebRequestJsObject.cpp
+++ b/src/WebRequestJsObject.cpp
@@ -30,7 +30,7 @@ namespace
{
public:
WebRequestThread(AdblockPlus::JsEnginePtr jsEngine, AdblockPlus::JsValueList& arguments)
- : jsEngine(jsEngine), url(arguments[0]->AsString())
+ : Thread(true), jsEngine(jsEngine), url(arguments[0]->AsString())
{
if (!url.length())
throw std::runtime_error("Invalid string passed as first argument to GET");
@@ -78,7 +78,6 @@ namespace
AdblockPlus::JsValueList params;
params.push_back(resultObject);
callback->Call(params);
- delete this;
}
private:
« src/Thread.cpp ('K') | « src/Thread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld