lua-sqlite icon indicating copy to clipboard operation
lua-sqlite copied to clipboard

Memory Leak

Open brimworks opened this issue 10 years ago • 1 comments

If you call stmt:rows("_l") or stmt:rows("_t"), and you don't iterate over all elements, then the col_info * "light user data" will never be freed. I'm willing to fix this, but I don't want to bother unless your on-board with my suggested fix.

Specifically, I think the col_info* should be a full user-data rather than a light user-data so we can use Lua to do the memory allocation (and deallocation) for us.

For now I'm simply avoiding the "_l" and "_t" special cases.

Thanks, -Brian

brimworks avatar Feb 03 '15 14:02 brimworks

I'm happy to merge these once I have a chance to test them, but I haven't used this library in ages and I should probably review the whole thing for Lua 5.3 / LuaJIT compatibility and audit memory leaks with Valgrind, too.

Thanks for your time!

silentbicycle avatar Feb 03 '15 15:02 silentbicycle