fix: Only register event shutting down the network interface once

This commit is contained in:
WerWolv
2023-11-04 23:41:52 +01:00
parent e7eaa2b194
commit ec95c260bb

View File

@@ -22,9 +22,11 @@ namespace hex::plugin::builtin {
static wolv::net::SocketServer networkInterfaceServer(31337);
EventManager::subscribe<EventImHexClosing>([]{
networkInterfaceServer.shutdown();
});
AT_FIRST_TIME {
EventManager::subscribe<EventImHexClosing>([]{
networkInterfaceServer.shutdown();
});
};
networkInterfaceServer.accept([](auto, const std::vector<u8> &data) -> std::vector<u8> {
nlohmann::json result;