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

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

Issue 2694103004: Cleanup app snapshots on isolate/vm exit. (Closed)
Patch Set: merge Created 3 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 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 #include "bin/isolate_data.h"
6 #include "bin/snapshot_utils.h"
7
8 namespace dart {
9 namespace bin {
10
11 IsolateData::IsolateData(const char* url,
12 const char* package_root,
13 const char* packages_file,
14 AppSnapshot* app_snapshot)
15 : script_url((url != NULL) ? strdup(url) : NULL),
16 package_root(NULL),
17 packages_file(NULL),
18 udp_receive_buffer(NULL),
19 builtin_lib_(NULL),
20 loader_(NULL),
21 app_snapshot_(app_snapshot) {
22 if (package_root != NULL) {
23 ASSERT(packages_file == NULL);
24 this->package_root = strdup(package_root);
25 } else if (packages_file != NULL) {
26 this->packages_file = strdup(packages_file);
27 }
28 }
29
30
31 IsolateData::~IsolateData() {
32 free(script_url);
33 script_url = NULL;
34 free(package_root);
35 package_root = NULL;
36 free(packages_file);
37 packages_file = NULL;
38 free(udp_receive_buffer);
39 udp_receive_buffer = NULL;
40 if (builtin_lib_ != NULL) {
41 Dart_DeletePersistentHandle(builtin_lib_);
42 }
43 delete app_snapshot_;
44 app_snapshot_ = NULL;
45 }
46
47 } // namespace bin
48 } // 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