GCMouse causes onDisappear to not run after dismissImmersiveSpace?

I have created a simple app that enters and exits an immersive space. I have not changed the basic code that gets created when you start a new visionOS project.

I have connected a Magic Mouse to the AVP using BT.

I have added a simple call to print(GCMouse.mice())and I have also tried print(GCController.controllers()) when the RealityView is launched inside the body closure. If I do not have the GCMouse/GCController call, everything works fine.

However, with this perfect storm (Magic Mouse connected, enter immersive space, call GCMouse/GCController, exit immersive space) the onDisappear closure is never called, so I cannot reset my ToggleImmersiveSpace button out of disabled state due to transition.

Once I power off and disconnect the mouse, the onDisappear closure is finally called.

I have attempted to profile the issue, and I see that right before the onDisappear is called after the controllers are disconnected (which is long after the dismissImmersiveSpace was called), I see two mentions of some deallocation/destruction of GameController:

-[GCMouse.cxx_destruct]

-[GCPhysicalInputProfile(Pooling) release]

Hello

Based on your description it seems like a thread may be blocked, which is preventing the onDisappear closure from being called. If you use the debugger to pause the application after exiting the immersive space, what does thread backtrace all print?

GCMouse causes onDisappear to not run after dismissImmersiveSpace?
 
 
Q