mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-15 23:17:14 +00:00
sculpt manager: prevent double destruction
The '_currently_constructed' pointer caches the information about which 'Launched_child' is currently configured in the menu. When discarding the runtime (e.g., when un-using a file system) at this point, this cached pointer was not invalidated while all 'Launched_child' objects would be freed (including the currently constructed one). On the next attempt to construct a new child, the sculpt manager attempted to destruct the 'Launched_child' referred by the (now outdated) '_currently_constructed' again. Fixes #3240
This commit is contained in:
parent
935abb55b7
commit
aeb7e7cd7c
@ -396,6 +396,12 @@ class Sculpt::Runtime_state : public Runtime_info
|
||||
|
||||
void reset_abandoned_and_launched_children()
|
||||
{
|
||||
/*
|
||||
* Invalidate '_currently_constructed' pointer, which may point
|
||||
* to a to-be-destructed 'Launched_child'.
|
||||
*/
|
||||
discard_construction();
|
||||
|
||||
_abandoned_children.for_each([&] (Abandoned_child &child) {
|
||||
destroy(_alloc, &child); });
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user