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

Unified Diff: mojo/public/cpp/application/lib/mojo_main_chromium.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_chromium.cc
diff --git a/mojo/public/cpp/application/lib/mojo_main_chromium.cc b/mojo/public/cpp/application/lib/mojo_main_chromium.cc
index 269b7a2f036ab77636ee22986420280671c62be4..d8c5e3f643493ecc9f6e0591d0746e2c7c9f855e 100644
--- a/mojo/public/cpp/application/lib/mojo_main_chromium.cc
+++ b/mojo/public/cpp/application/lib/mojo_main_chromium.cc
@@ -14,12 +14,16 @@ extern "C" APPLICATION_EXPORT MojoResult CDECL MojoMain(
#if !defined(COMPONENT_BUILD)
base::AtExitManager at_exit;
#endif
- base::MessageLoop loop;
- scoped_ptr<mojo::ApplicationDelegate> delegate(
- mojo::ApplicationDelegate::Create());
- mojo::ApplicationImpl app(delegate.get());
- app.BindShell(shell_handle);
- loop.Run();
+ scoped_ptr<mojo::ApplicationDelegate> delegate;
+ {
+ // We have to shut down the MessageLoop before destroying the
+ // ApplicationDelegate.
+ base::MessageLoop loop;
+ delegate.reset(mojo::ApplicationDelegate::Create());
+ mojo::ApplicationImpl app(delegate.get());
+ app.BindShell(shell_handle);
+ loop.Run();
+ }
return MOJO_RESULT_OK;
}
« no previous file with comments | « mojo/public/cpp/application/interface_factory_with_context.h ('k') | mojo/public/cpp/application/lib/mojo_main_standalone.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698