Commit ccc013e
Fix QSharedMemory on macOS with Qt 6.6+ (#215)
Qt 6.6+ defaults to POSIX Realtime shared memory via QNativeIpcKey on
macOS. However, POSIX shared memory (shm_open) requires Qt to be built
with -feature-ipc_posix and has strict naming requirements.
Many Qt installations (including Homebrew) don't have POSIX IPC enabled,
causing the error:
QSharedMemory::KeyError "QSharedMemory::attach (shm_open): bad name"
Use legacyNativeKey() to force System V shared memory, which works
reliably on all macOS configurations regardless of Qt build options.
Fixes single instance detection failing on macOS with Qt 6.6+.
Co-authored-by: Omkar Darekar <Omkar.Darekar@veritas.com>
Co-authored-by: Itay Grudev <itay+git2020@grudev.com>1 parent b117282 commit ccc013e
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
108 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
109 | 113 | | |
110 | 114 | | |
111 | 115 | | |
| |||
0 commit comments