"Handle is not allocated" when exiting play mode, with duplicate objects
I've noticed that the system throws an error when exiting play mode, if there are several objects that subscribe to actions in the same action map:
InvalidOperationException: Handle is not allocated System.Runtime.InteropServices.GCHandle.get_Target () at ....InputSystem/Actions/InputActionState.cs:3132
This happens in my project where there are several active objects on screen listening for the player's inputs. I noticed that the same thing happens in the simpleDemo project in this repo, if I duplicate the player object and then enter/exit play mode.
Same here! Thanks!
I can't remember right now what exactly led my code to same errors, but this is related with disabling and disposing your map and actions. Something like calling map.Dispose() won't disable it automatically and later if you try (or some internal code triggers) .Disable() map, it will try to clear out already cleared memory.
I cannot repro this with 0.3.0-preview. Duplicating Player object in the SimpleDemo scene doesn't trigger the error.
That's great news! I just updated to 0.3.1 and confirmed the fix with a much more aggressive test case. Thank you!