Commit ab98b58b authored by Xiyuan Xia's avatar Xiyuan Xia Committed by Commit Bot

cros: Fix use-after-free in tap visualizer app

|display_id_to_renderer_| has dependency on aura. When used as
a mojo app, |aura_init_| provide aura and should be released
after it.

Bug: None
Change-Id: Ice4410def29166c77ebc8431fd62995c5dbe57f7
Reviewed-on: https://chromium-review.googlesource.com/c/1357082Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Xiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612844}
parent ab632b25
...@@ -56,11 +56,13 @@ class TapVisualizerApp : public service_manager::Service, ...@@ -56,11 +56,13 @@ class TapVisualizerApp : public service_manager::Service,
service_manager::ServiceBinding service_binding_; service_manager::ServiceBinding service_binding_;
// Must be released after |display_id_to_renderer_| which indirectly depends
// on aura.
std::unique_ptr<views::AuraInit> aura_init_;
// Maps display::Display::id() to the renderer for that display. // Maps display::Display::id() to the renderer for that display.
std::map<int64_t, std::unique_ptr<TapRenderer>> display_id_to_renderer_; std::map<int64_t, std::unique_ptr<TapRenderer>> display_id_to_renderer_;
std::unique_ptr<views::AuraInit> aura_init_;
DISALLOW_COPY_AND_ASSIGN(TapVisualizerApp); DISALLOW_COPY_AND_ASSIGN(TapVisualizerApp);
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment