Hive icon indicating copy to clipboard operation
Hive copied to clipboard

Prevent multiple instances of Hive to run at the same time

Open christophe-calmejane opened this issue 6 years ago • 3 comments

Part of code already written in main.cpp, but it's not complete! It's imperative to check for the runnnig pid, or a crash will lock Hive until reboot on macOS (shared memory not properly released by the OS when the last instance is killed)

christophe-calmejane avatar Aug 06 '18 09:08 christophe-calmejane

Maybe take a look at https://github.com/itay-grudev/SingleApplication

christophe-calmejane avatar Aug 08 '18 12:08 christophe-calmejane

Or use Fastbuild SystemMutex class: https://github.com/fastbuild/fastbuild/blob/main/Code/Core/Process/SystemMutex.cpp

christophe-calmejane avatar Sep 24 '21 08:09 christophe-calmejane

It might even be more useful to ask the user if it wants to start Hive on another "port" if it's already running, but it means we have to keep a list of the running processes in a lock file, instead of just one.

christophe-calmejane avatar Jul 27 '22 12:07 christophe-calmejane