-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Too many open files error #55
Comments
Also, |
Hi. I'm having the same problem with fonts. It seems like the following function loads a new instance of the same font file every time we create a new TextActor. The second line of the function creates a new TextActor and it never closes the TextActor. function TextActor(text::String, font_name::String; font_size=24, color=Int[255,255,0,255], kv...)
font = TTF_OpenFont(file_path(font_name, :fonts), font_size)
sf = TTF_RenderText_Blended(font, text, SDL_Color(color...))
w, h = size(sf)
a = Actor(
text,
sf,
Rect(0, 0, Int(w), Int(h)),
[1.,1.],
0,
255,
Dict{Symbol,Any}()
)
for (k, v) in kv
setproperty!(a, k, v)
end
return a
end``` |
@MrZarfir good find. Can you try adding a |
Indeed, my problem goes away after adding a closing call. I don't have access to push the new change to a new branch, but it would be appreciated if you can add this small change (unless you can give me access so I can push it). Thank you for your quick response. |
@MrZarfir You don't need push access to collaborate on an open source repository. You typically create a fork, and make a pull request from there. See this github documentation Hower, in this case, I have created this pull request here: #64 |
I made my own version of the flappy bird game, and I face this issue if I play it for a while. It looks like GameZero is not GC-ing some images(?)
Note, I change the bird image everytime I press space, and for a game like flappy bird, that is quite often. I thought the image will be reused?
The text was updated successfully, but these errors were encountered: