Allow multiple instances to run if environment variable is set

If the environment variable HIFI_ALLOW_MULTIPLE_INSTANCES is present, the value is ignored,
then you can have multiple copies of interface running on the same machine.
This commit is contained in:
Anthony J. Thibault 2017-02-03 10:53:26 -08:00
parent 1ddafa3cee
commit f8e6bd8c6b

View file

@ -74,6 +74,11 @@ int main(int argc, const char* argv[]) {
instanceMightBeRunning = !sharedMemory.create(1, QSharedMemory::ReadOnly);
#endif
// allow multiple interfaces to run if this environment variable is set.
if (QProcessEnvironment::systemEnvironment().contains("HIFI_ALLOW_MULTIPLE_INSTANCES")) {
instanceMightBeRunning = false;
}
if (instanceMightBeRunning) {
// Try to connect and send message to existing interface instance
QLocalSocket socket;