Tangent128 / luasdl2

A pure C binding of SDL 2.0 for Lua 5.1, Lua 5.2, and LuaJIT.
ISC License
385 stars 74 forks source link

Channel:pop() is leaking memory #91

Open jgmdev opened 2 years ago

jgmdev commented 2 years ago

After doing a channel pop the list is rotated but the first element is never freed and ram usage continues growing.

https://github.com/Tangent128/luasdl2/blob/master/src/channel.c#L156

jgmdev commented 2 years ago

As another note the channelClear doesn't reinitializes the first element to null and the last element to first element pointer.