microsoft / GDK

Microsoft Public GDK
http://aka.ms/gamedevdocs
Other
1.48k stars 99 forks source link

RawGameControllerRemoved event provides broken instance #45

Open LordOfDragons opened 7 months ago

LordOfDragons commented 7 months ago

Assign a listener to the RawGameController.RawGameControllerRemoved event.

Upon firing the even try to find the controller in the std::vector of controls you stored away. You will find no match since the controller provided in the RawGameControllerRemoved event is broken and does not match anymore the one you added in RawGameControllerAdded. It is as if the operator==() is not working making it impossible to match the controller.

As a result RawGameController can be added when attached to the system but never removed causing broken controller instances to pile up in your application.