Fixed bug with memory leak for drawing primitives, but leak is present for text drawing