Mutex not working properly on Pi, works elsewhere

I have the following code at the start of my app so it doesn’t have multiple copies running. It works great on Windows, Linux and MacOS. On a Raspberry Pi using the remote debugger, it thinks another copy was loaded and display the MessageBox shown in the code. Then the program starts after I acknowledge the MessageBox.

I have a workaround that will not run the short Mutex code if it’s a Raspberry Pi, but then I may run the risk of having more than one copy running.

I thought it might be something with the Remote Debugging, but it happens with a compiled version run on the system. Anyone seen this and have an idea of how to prevent the issue without turning off checking for another copy running?

Btw, it doesn’t happen on my Linux Mint system, only with the Raspberry Pi 4 and 64Bit OS. It’s not happening on my Pi 3.

mMutex = New Mutex("MPAddressBook")
If Not mMutex.TryEnter Then
  MessageBox("You cannot have more than one copy of this app running!")
  mMutex = Nil
  Quit
End If

https://xojo.com/issues

This is strange, not it’s not doing it. I want to make sure I can duplicate it before posting an issue.

From your description this sounds like the bug where you can’t call quit from App.Opening. Have you tried using Timer.CallLater to call a method that quits the app?

I have not tried that. I’ll check that out…If that bug is the problem, it’s not happening consistently and it only happens on my Raspberry Pi 4 with its version of Linux. Does not happen on Linux Mint, Windows or MacOS. I’d think the bug would appear everywhere unless it’s specific to Raspberry Pi 4 OS.