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

Unified Diff: mojo/public/cpp/application/lib/mojo_main_standalone.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix network_service_loader Created 6 years, 5 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: mojo/public/cpp/application/lib/mojo_main_standalone.cc
diff --git a/mojo/public/cpp/application/lib/mojo_main_standalone.cc b/mojo/public/cpp/application/lib/mojo_main_standalone.cc
index 0ba078b25cf287bdcbac5bfaa775d36b99f85eed..6071b6b4f280aefe24b8b7ce3523f2c3341da880 100644
--- a/mojo/public/cpp/application/lib/mojo_main_standalone.cc
+++ b/mojo/public/cpp/application/lib/mojo_main_standalone.cc
@@ -10,12 +10,17 @@
extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain(
MojoHandle shell_handle) {
mojo::Environment env;
- mojo::RunLoop loop;
- mojo::ApplicationDelegate* delegate = mojo::ApplicationDelegate::Create();
+ mojo::ApplicationDelegate* delegate = NULL;
{
- mojo::ApplicationImpl app(delegate);
- app.BindShell(shell_handle);
- loop.Run();
+ // We have to shut down the RunLoop before destroying the
+ // ApplicationDelegate.
+ mojo::RunLoop loop;
+ delegate = mojo::ApplicationDelegate::Create();
+ {
+ mojo::ApplicationImpl app(delegate);
+ app.BindShell(shell_handle);
+ loop.Run();
+ }
}
delete delegate;
« no previous file with comments | « mojo/public/cpp/application/lib/mojo_main_chromium.cc ('k') | mojo/public/cpp/application/lib/service_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698