aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2019-01-29 09:53:14 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2019-01-29 09:53:14 +0900
commitb9eac3cd4c955a84f1b381f15dc6d3f53035a309 (patch)
tree195c6dd859d804b434c0b795e56db84c915a39ab
parent6e1a59df13511cd872163610cb16efe4816274e7 (diff)
Avoid seg fault when no output exists
When no output object such like HDMI, Window Manager crashes on initialize. This patch avoid crashes but no care for hot plug of display. Bug-AGL : SPEC-2136 Change-Id: I30bad0377d0ac646cead0bba1f1ae35952e3fb07 Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
-rw-r--r--src/window_manager.cpp20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/window_manager.cpp b/src/window_manager.cpp
index e9cc53a..28692ca 100644
--- a/src/window_manager.cpp
+++ b/src/window_manager.cpp
@@ -194,13 +194,19 @@ int WindowManager::init()
this->controller->chooks = &this->chooks;
// This protocol needs the output, so lets just add our mapping here...
- this->controller->add_proxy_to_id_mapping(
- this->outputs.front()->proxy.get(),
- wl_proxy_get_id(reinterpret_cast<struct wl_proxy *>(
- this->outputs.front()->proxy.get())));
-
- // Create screen
- this->controller->create_screen(this->outputs.front()->proxy.get());
+ if(!this->outputs.empty()) {
+ // FIXME : Work around to avoid signal 11. Window Manager can't handle hotplug.
+ this->controller->add_proxy_to_id_mapping(
+ this->outputs.front()->proxy.get(),
+ wl_proxy_get_id(reinterpret_cast<struct wl_proxy *>(
+ this->outputs.front()->proxy.get())));
+
+ // Create screen
+ this->controller->create_screen(this->outputs.front()->proxy.get());
+ }
+ else {
+ HMI_WARNING("wm", "No output object. Window Manager can't handle screen");
+ }
// Set display to controller
this->controller->display = this->display;