(ogl) Fix overuse of memory and leak.