Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Unified Diff: runtime/vm/thread.cc

Issue 1677043003: 1. Fix memory leaks reported by running a simple test using ASAN (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address-code-review Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/cpuinfo_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index 0fa2d403f06f2e5fa2a59886046097e637225ff6..c5c6e70a7bb8524c897de04779dcfa75b19f837f 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -24,6 +24,15 @@ namespace dart {
Thread::~Thread() {
// We should cleanly exit any isolate before destruction.
ASSERT(isolate_ == NULL);
+ // There should be no top api scopes at this point.
+ ASSERT(api_top_scope() == NULL);
+ // Delete the resusable api scope if there is one.
+ if (api_reusable_scope_) {
+ delete api_reusable_scope_;
+ api_reusable_scope_ = NULL;
+ }
+ delete thread_lock_;
+ thread_lock_ = NULL;
}
« no previous file with comments | « runtime/vm/cpuinfo_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698