-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Functions that create something that needs to be destroyed later should probably associate the finalizer with ffi.gc. For example:
function sdl.createTextureFromSurface (...)
return ffi.gc(sdl.C.SDL_CreateTextureFromSurface(...), sdl.C.SDL_DestroyTexture)
endThis might cause unexpected behavior in certain cases (for example a cursor could get GC'd while still in use), but overall would probably be worth it. I'd be willing to make a PR if there's any interest in this.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels