From 94f9e989df9e67363e8dd50b9b96ae7d2a10c2f4 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Thu, 2 Oct 2014 22:19:29 +0200 Subject: [PATCH] wm: invalidate dataspaces on model updates If the Rom_session::update function returns false, the ROM dataspace may have been physically destructed (and core has removed all mappings). In this case, we have to omit the detach operation in the destructor of 'Attached_dataspace' to avoid detaching the same region twice. --- repos/gems/src/server/wm/main.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/repos/gems/src/server/wm/main.cc b/repos/gems/src/server/wm/main.cc index c0bd2ca28..9be9f89cd 100644 --- a/repos/gems/src/server/wm/main.cc +++ b/repos/gems/src/server/wm/main.cc @@ -98,8 +98,11 @@ struct Wm::Main void handle_focus_update(unsigned) { try { - if (!focus_ds.is_constructed() || focus_rom.update() == false) + if (!focus_ds.is_constructed() || focus_rom.update() == false) { + if (focus_ds.is_constructed()) + focus_ds->invalidate(); focus_ds.construct(focus_rom.dataspace()); + } unsigned long win_id = 0; @@ -125,9 +128,11 @@ struct Wm::Main void handle_resize_request_update(unsigned) { try { - if (!resize_request_ds.is_constructed() - || resize_request_rom.update() == false) + if (!resize_request_ds.is_constructed() || resize_request_rom.update() == false) { + if (resize_request_ds.is_constructed()) + resize_request_ds->invalidate(); resize_request_ds.construct(resize_request_rom.dataspace()); + } char const * const node_type = "window";