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

Unified Diff: samples/shell.cc

Issue 53089: Fixed test memory leaks (Closed)
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
Index: samples/shell.cc
diff --git a/samples/shell.cc b/samples/shell.cc
index d85e6ea6e5238efedf65140f70d33d6a6ec2ae53..5c46c10a695cfe3fa422c0a06d3bf3f80dbb045c 100644
--- a/samples/shell.cc
+++ b/samples/shell.cc
@@ -45,7 +45,7 @@ v8::Handle<v8::String> ReadFile(const char* name);
void ReportException(v8::TryCatch* handler);
-int main(int argc, char* argv[]) {
+int RunMain(int argc, char* argv[]) {
v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
v8::HandleScope handle_scope;
// Create a template for the global object.
@@ -95,11 +95,17 @@ int main(int argc, char* argv[]) {
return 1;
}
}
- if (run_shell) RunShell(context);
return 0;
}
+int main(int argc, char* argv[]) {
+ int result = RunMain(argc, argv);
+ v8::V8::Dispose();
+ return result;
+}
+
+
// Extracts a C string from a V8 Utf8Value.
const char* ToCString(const v8::String::Utf8Value& value) {
return *value ? *value : "<string conversion failed>";

Powered by Google App Engine
This is Rietveld 408576698