gregjohnson2017 / tabula-editor

An image editor built from scratch with OpenGL in Go.
MIT License
7 stars 0 forks source link

Fix OpenGL object leaks #79

Open kroppt opened 3 years ago

kroppt commented 3 years ago

I created a GL trace of the application, just opening and closing. I ran $ apitrace leaks tabula-editor.trace and got:

3541: error: texture 1 was not destroyed until <EOF>
3553: error: texture 2 was not destroyed until <EOF>
3719: error: texture 3 was not destroyed until <EOF>
3765: error: texture 4 was not destroyed until <EOF>
3560: error: buffer 1 was not destroyed until <EOF>
3564: error: buffer 2 was not destroyed until <EOF>
3568: error: buffer 3 was not destroyed until <EOF>
3570: error: buffer 4 was not destroyed until <EOF>
3582: error: buffer 5 was not destroyed until <EOF>
<snip>

It goes on a while. While I am not sure apitrace is accurate, looking at the code, it does appear we are missing destructors in some places.