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.
This commit is contained in:
Norman Feske 2014-10-02 22:19:29 +02:00
parent 2f5cff5347
commit 94f9e989df
1 changed files with 8 additions and 3 deletions

View File

@ -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";