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

Unified Diff: src/FileSystemJsObject.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
« no previous file with comments | « no previous file | src/GlobalJsObject.cpp » ('j') | src/Thread.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FileSystemJsObject.cpp
diff --git a/src/FileSystemJsObject.cpp b/src/FileSystemJsObject.cpp
index 4343e104af591ab9dc5861c77f7ec8b60f6ed29e..2ed1fd55a663692a5fa7097f90cc3396b3ac9e18 100644
--- a/src/FileSystemJsObject.cpp
+++ b/src/FileSystemJsObject.cpp
@@ -19,6 +19,7 @@
#include <stdexcept>
#include <sstream>
#include <vector>
+#include <thread>
sergei 2016/11/21 10:03:59 Sorry, overlooked, it's not used, so I won't inclu
#include <AdblockPlus/JsValue.h>
#include "FileSystemJsObject.h"
@@ -34,7 +35,7 @@ namespace
{
public:
IoThread(JsEnginePtr jsEngine, JsValuePtr callback)
- : jsEngine(jsEngine), fileSystem(jsEngine->GetFileSystem()),
+ : Thread(true), jsEngine(jsEngine), fileSystem(jsEngine->GetFileSystem()),
callback(callback)
{
}
@@ -79,7 +80,6 @@ namespace
JsValueList params;
params.push_back(result);
callback->Call(params);
- delete this;
}
private:
@@ -118,7 +118,6 @@ namespace
JsValueList params;
params.push_back(errorValue);
callback->Call(params);
- delete this;
}
private:
@@ -156,7 +155,6 @@ namespace
JsValueList params;
params.push_back(errorValue);
callback->Call(params);
- delete this;
}
private:
@@ -194,7 +192,6 @@ namespace
JsValueList params;
params.push_back(errorValue);
callback->Call(params);
- delete this;
}
private:
@@ -239,7 +236,6 @@ namespace
JsValueList params;
params.push_back(result);
callback->Call(params);
- delete this;
}
private:
« no previous file with comments | « no previous file | src/GlobalJsObject.cpp » ('j') | src/Thread.cpp » ('J')

Powered by Google App Engine
This is Rietveld