[Interest] QSharedMemory::create returns out of resources errors on a few macOS machines

David C. Partridge david.partridge at perdrix.co.uk
Sun Jul 2 10:23:26 CEST 2023


Maybe instead of QSharedMemory you could use
boost::interprocess::named_mutex?

e.g.
	#include <boost/interprocess/sync/named_mutex.hpp>
	namespace bip = boost::interprocess;
	:
	:
	bip::named_mutex dssMutex{ bip::open_or_create,
"MyApp.Named.Mutex.Name" };
	bip::scoped_lock<bip::named_mutex> lk(dssMutex, bip::defer_lock);
	const bool firstInstance{ lk.try_lock() };
	printf("  firstInstance: %s", firstInstance ? "true" : "false");

in your main()?
-----Original Message-----
From: Interest <interest-bounces at qt-project.org> On Behalf Of Alexander
Dyagilev
Sent: 01 July 2023 11:04
To: interest at qt-project.org
Subject: [Interest] QSharedMemory::create returns out of resources errors on
a few macOS machines

Hello,

Some rare uses keeps reporting that our app can't start due to this error.

We use QSharedMemory to keep track of running instances of our app.



More information about the Interest mailing list