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

Side by Side Diff: runtime/bin/isolate_data.cc

Issue 2720723005: VM: Fix an app-jit related shutdown race. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « runtime/bin/isolate_data.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "bin/isolate_data.h" 5 #include "bin/isolate_data.h"
6 #include "bin/snapshot_utils.h" 6 #include "bin/snapshot_utils.h"
7 7
8 namespace dart { 8 namespace dart {
9 namespace bin { 9 namespace bin {
10 10
(...skipping 11 matching lines...) Expand all
22 dependencies_(NULL) { 22 dependencies_(NULL) {
23 if (package_root != NULL) { 23 if (package_root != NULL) {
24 ASSERT(packages_file == NULL); 24 ASSERT(packages_file == NULL);
25 this->package_root = strdup(package_root); 25 this->package_root = strdup(package_root);
26 } else if (packages_file != NULL) { 26 } else if (packages_file != NULL) {
27 this->packages_file = strdup(packages_file); 27 this->packages_file = strdup(packages_file);
28 } 28 }
29 } 29 }
30 30
31 31
32 void IsolateData::OnIsolateShutdown() {
33 if (builtin_lib_ != NULL) {
34 Dart_DeletePersistentHandle(builtin_lib_);
35 builtin_lib_ = NULL;
36 }
37 }
38
39
32 IsolateData::~IsolateData() { 40 IsolateData::~IsolateData() {
33 free(script_url); 41 free(script_url);
34 script_url = NULL; 42 script_url = NULL;
35 free(package_root); 43 free(package_root);
36 package_root = NULL; 44 package_root = NULL;
37 free(packages_file); 45 free(packages_file);
38 packages_file = NULL; 46 packages_file = NULL;
39 free(udp_receive_buffer); 47 free(udp_receive_buffer);
40 udp_receive_buffer = NULL; 48 udp_receive_buffer = NULL;
41 if (builtin_lib_ != NULL) {
42 Dart_DeletePersistentHandle(builtin_lib_);
43 }
44 delete app_snapshot_; 49 delete app_snapshot_;
45 app_snapshot_ = NULL; 50 app_snapshot_ = NULL;
46 } 51 }
47 52
48 } // namespace bin 53 } // namespace bin
49 } // namespace dart 54 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/isolate_data.h ('k') | runtime/bin/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698