3 ms·
It turns out that the event system would take it upon itself to free() the event's void pointer after processing the event. You could set the pointer's value
by Retric 17y ago
It turns out that the event system would take it upon itself to free() the event's void pointer after processing the event.
You could set the pointer's value to be the controler's ID and then set it to null while you handle the event, and before you pass it down the chain. Or, the OS might be ok (and do nothing) when trying to free memory that's in the middle of a block of allocated memory.
- vidarh 17y agoIf so his original approach of putting the controller id in a region allocated for the purpose and putting the pointer to that region in the event would have worked just as well and he wouldn't need to do what he did.