rytc / enet-jai

Native Jai port of the ENet Reliable UDP networking library
MIT License
10 stars 2 forks source link

Fix porting error: replace array_free with array_reset #10

Closed okmatija closed 10 months ago

okmatija commented 10 months ago

The array_reset function makes sure the counts are set to 0 as well. This fixes a regular crash I was getting in my game when I ran it with local client and server instances and then connected/reconnected a bunch. The problem I actually hit was related to peer.channels not calling array_reset, but from looking at the surrounding code in the other places I changed it I think they can/should also be changed to array_reset (if you know the code well, it would be great if you checked these too)