-
Notifications
You must be signed in to change notification settings - Fork 75
Closed
Description
I have a suspicion that once ruby2d reads the font, it neglects to close the file; this means that I'm currently unable to create more than 239 Text instances:
(['Abc'] * 239).each do |t|
Text.new(t, font: __dir__ + '/../fonts/arial.ttf')
endThe code above works fine, but if I replace 239 with 240, I get the error Error Domain=NSPOSIXErrorDomain Code=24 "Too many open files"
I suggest that in ext/ruby2d/text.c at line 29 after opening the font with TTF_OpenFont it should also be closed with TTF_CloseFont, as per instructions here: https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf_18.html#SEC18
I'd try it locally myself, but I really don't know how to overwrite a C file in a gem.
Metadata
Metadata
Assignees
Labels
No labels