diff --git a/repos/base/src/core/include/signal_broker.h b/repos/base/src/core/include/signal_broker.h index cb0548f116..dcc5245d68 100644 --- a/repos/base/src/core/include/signal_broker.h +++ b/repos/base/src/core/include/signal_broker.h @@ -75,18 +75,22 @@ class Genode::Signal_broker void free_context(Signal_context_capability context_cap) { - Signal_context_component *context; + Signal_context_component *context = nullptr; _context_ep.apply(context_cap, [&] (Signal_context_component *c) { - context = c; - if (!context) { + + if (!c) { warning("specified signal-context capability has wrong type"); return; } + context = c; + _context_ep.dissolve(context); }); - destroy(&_contexts_slab, context); + + if (context) + destroy(&_contexts_slab, context); } void submit(Signal_context_capability cap, unsigned cnt)