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

Unified Diff: include/AdblockPlus/V8ValueHolder.h

Issue 12647002: Fix memory leaks in libadblockplus (Closed)
Patch Set: Created Oct. 6, 2013, 10:21 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 | « no previous file | src/FilterEngine.cpp » ('j') | src/FilterEngine.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/V8ValueHolder.h
===================================================================
--- a/include/AdblockPlus/V8ValueHolder.h
+++ b/include/AdblockPlus/V8ValueHolder.h
@@ -49,7 +49,14 @@
{
reset(isolate, value);
}
-
+ ~V8ValueHolder()
+ {
+ if (this->value.get())
+ {
+ this->value->Dispose(this->isolate);
+ this->value.reset(0);
+ }
Wladimir Palant 2013/10/08 08:12:19 Better avoid the code duplication here: reset(0,
+ }
void reset(v8::Isolate* isolate, v8::Persistent<T> value)
{
if (this->value.get())
« no previous file with comments | « no previous file | src/FilterEngine.cpp » ('j') | src/FilterEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld