Fix some easy leaks reported by asan.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3411 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2017-11-18 23:02:08 +00:00
parent 0ef8a8919a
commit 2bc62b2ecd
3 changed files with 7 additions and 1 deletions

View File

@ -98,6 +98,7 @@ Task::Task() {
++_count;
v8::Isolate::CreateParams options;
options.array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator();
_allocator = options.array_buffer_allocator;
_isolate = v8::Isolate::New(options);
_isolate->SetData(0, this);
_isolate->SetCaptureStackTraceForUncaughtExceptions(true, 16);
@ -117,6 +118,9 @@ Task::~Task() {
_isolate->Dispose();
_isolate = 0;
delete _allocator;
_allocator = nullptr;
uv_loop_delete(_loop);
--_count;
}