Fix memory leak in OpenGL runtime