Skip to content
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

Haskell RTS frees glContext prematurely #63

Open
spikeyarmaku opened this issue Aug 16, 2014 · 0 comments
Open

Haskell RTS frees glContext prematurely #63

spikeyarmaku opened this issue Aug 16, 2014 · 0 comments

Comments

@spikeyarmaku
Copy link

The problem: when writing a HsSDL2 code that uses OpenGL, no GL update gets displayed after a few frames.

Tha cause is that currently glContext is a ForeignPtr, which has a finalizer, that calls SDL_GL_DeleteContext when the Haskell RTS has no reference to the pointer. Unfortunately since we don't use this pointer explicitly in the code after we create it with glCreateContext, Haskell RTS frees it after some time. (Using touchForeignPtr will prevent the RTS from calling the finalizer.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant