Fixes GL memory leaks.