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

Unified Diff: ui/views/examples/examples_main.cc

Issue 1871253002: aura: Require explicit ownership of the Env instance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot.merge Created 4 years, 8 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
« no previous file with comments | « ui/aura/test/run_all_unittests.cc ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/examples_main.cc
diff --git a/ui/views/examples/examples_main.cc b/ui/views/examples/examples_main.cc
index 11096a781c18382a10dfd798223010dcaf86033c..dba6dc95282921e65d4476b2d27c0c553bf08bcd 100644
--- a/ui/views/examples/examples_main.cc
+++ b/ui/views/examples/examples_main.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <memory>
+
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
@@ -81,7 +83,7 @@ int main(int argc, char** argv) {
#endif
#if defined(USE_AURA)
- aura::Env::CreateInstance(true);
+ std::unique_ptr<aura::Env> env = aura::Env::CreateInstance();
aura::Env::GetInstance()->set_context_factory(context_factory.get());
#endif
ui::InitializeInputMethodForTesting();
@@ -108,7 +110,7 @@ int main(int argc, char** argv) {
ui::ShutdownInputMethod();
#if defined(USE_AURA)
- aura::Env::DeleteInstance();
+ env.reset();
#endif
return 0;
« no previous file with comments | « ui/aura/test/run_all_unittests.cc ('k') | ui/views/mus/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698