From f650f2e91be32e1809648f09b06278433bf1577f Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 3 Sep 2024 15:05:32 +0200 Subject: [PATCH] gui_fb: reset signal handlers when closing fb The gui_fb client may have installed a custom sync_sigh and mode_sigh. Reset those signal handlers at the GUI server should the client disappear. Otherwise, the GUI server (nitpicker) continues to attempt transmitting sync signals to the no-longer existing component, spamming the log with "Warning: invalid signal-context capability" messages. --- repos/os/src/server/gui_fb/main.cc | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/repos/os/src/server/gui_fb/main.cc b/repos/os/src/server/gui_fb/main.cc index db02a179cb..ac9fd2d420 100644 --- a/repos/os/src/server/gui_fb/main.cc +++ b/repos/os/src/server/gui_fb/main.cc @@ -289,11 +289,30 @@ struct Nit_fb::Main : View_updater Input::Session_component input_session { env, env.ram() }; Framebuffer::Session_component fb_session { env.pd(), gui, *this, _initial_mode() }; + Static_root input_root { env.ep().manage(input_session) }; + /* * Attach root interfaces to the entry point */ - Static_root input_root { env.ep().manage(input_session) }; - Static_root fb_root { env.ep().manage(fb_session) }; + + struct Fb_root : Static_root + { + Main &_main; + + Fb_root(Main &main) + : + Static_root(main.env.ep().manage(main.fb_session)), + _main(main) + { } + + void close(Genode::Capability) override + { + _main.fb_session.sync_sigh(Genode::Signal_context_capability()); + _main.fb_session.mode_sigh(Genode::Signal_context_capability()); + } + }; + + Fb_root fb_root { *this }; /** * View_updater interface