From 3c5b3ae4e9b051494c60ddbf4a6ddd95eb606376 Mon Sep 17 00:00:00 2001 From: oxmox Date: Sun, 19 Feb 2023 16:33:23 +0100 Subject: [PATCH] it's alive! not pretty but alive! also remove the fork() spawner --- src/doompanning.cc | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/doompanning.cc b/src/doompanning.cc index d4677d9..b702051 100644 --- a/src/doompanning.cc +++ b/src/doompanning.cc @@ -84,40 +84,6 @@ void spawn_doom_posix_spawn(ControllerContext &ctx) ctx.dooms.emplace_back(ds); } -// nng does not like this at all and panics (for good reasons) -void spawn_doom_fork(ControllerContext &ctx) -{ - auto pid = fork(); - - if (pid < 0) - { - log_error("Could not spawn doom: %s", strerror(errno)); - return; - } - - if (pid == 0) // doomchild - { - log_info("doomchild %d cleaning the room", getpid()); - ImGui::DestroyContext(); - log_info("doomchild %d cleanup done", getpid()); - - const char *const argv[] = { DOOM_EXECUTABLE, nullptr }; - execvp(DOOM_EXECUTABLE, const_cast(argv)); - } - else if (pid > 0) // doomparent - { - DoomState ds; - ds.id = pid; - ds.texture = SDL_CreateTexture(ctx.renderer, SDL_PIXELFORMAT_RGB888, - SDL_TEXTUREACCESS_STREAMING, DoomScreenWidth, DoomScreenHeight); - if (!ds.texture) - dp_sdl_fatal("SDL_CreateTexture"); - - log_info("Spawned new doom, pid=%d", ds.id); - ctx.dooms.emplace_back(ds); - } -} - inline void spawn_doom(ControllerContext &ctx) { spawn_doom_posix_spawn(ctx);