steamvr_drv: reuse the live roomsetup guard on repeated Activate

A second start overwrote pid/ack, orphaning the first guard (own VR
connection, overlay, mailbox registration) and leaking its pipe fd.
Return early while the child is alive; reset ack state on respawn.
This commit is contained in:
lbgos committed 2026-10-13 00:38:42 +03:00
1 parent c049c3b69a
commit 0146ca92b6
1 file changed
+8
@@ -32,6 +32,14 @@ public:
}
bool start()
{
if (pid > 0) {
// Activate can run again on the same driver object. Reuse the live
// guard instead of orphaning it behind a second child.
if (waitpid(pid, nullptr, WNOHANG) == 0) return true;
pid = -1;
acknowledged = false;
if (acknowledgement >= 0) { close(acknowledgement); acknowledgement = -1; }
}
Dl_info module{};
char server[4096];
ssize_t length = readlink("/proc/self/exe", server, sizeof(server) - 1);