mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:27:45 +00:00
SpiceAgent: Gracefully exit when the Spice server disconnects
This commit is contained in:
parent
36d61c01bc
commit
35fdc7f8c8
3 changed files with 13 additions and 1 deletions
|
@ -35,7 +35,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
TRY(Core::System::unveil(nullptr, nullptr));
|
||||
|
||||
auto agent = TRY(SpiceAgent::SpiceAgent::create(SPICE_DEVICE));
|
||||
TRY(agent->start());
|
||||
|
||||
agent->on_disconnected_from_spice_server = [&]() {
|
||||
app->quit();
|
||||
};
|
||||
|
||||
TRY(agent->start());
|
||||
return app->exec();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue