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

Backend resource cleanup bug #12

Closed
mrduda opened this issue Dec 1, 2018 · 0 comments
Closed

Backend resource cleanup bug #12

mrduda opened this issue Dec 1, 2018 · 0 comments

Comments

@mrduda
Copy link

mrduda commented Dec 1, 2018

Hi,
I found a little yet annoying bug which causes severe issues after calling destroy() with px_render::Pipeline and subsequent call of createPipeline. There's one line missing in DestroyBackEndResource(), right after you call glDeleteProgram:
GLCHECK(glDeleteProgram(b->pipelines[pos].program));
b->pipelines[pos].program = 0; // <---- this one is required

Without this you'll get a lot of OpenGL errors by using deleted and reused Pipeline (since createPipeline reuses previously deleted Pipeline), because this check in ChangePipeline will always fail to execute the inner code in the if() block:
if (pi.second->program == 0) {

@pplux pplux closed this as completed in 0106601 Dec 13, 2018
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