On the first version the pointer was just used as an ID that was used by an hashtable, but using this way caused some slowdown. However I know that the current implementation is potentially unsafe, but since we're mostly getting events from that entries, the risks are controlled. Also I never experienced a crash caused by that.
However I agree that this part would need a better design. I'm available for working on improving this part on all the stack (from libindicator, to unity itself).
On the first version the pointer was just used as an ID that was used by an hashtable, but using this way caused some slowdown. However I know that the current implementation is potentially unsafe, but since we're mostly getting events from that entries, the risks are controlled. Also I never experienced a crash caused by that.
However I agree that this part would need a better design. I'm available for working on improving this part on all the stack (from libindicator, to unity itself).