The snippet of code below appears in another post on the forum.
As used below, would the glu functions result in a memory leak?
Would declaring qobj to be ‘static’ be a workaround?
Thanks.
[QUOTE=Carmine;1280195]The snippet of code below appears in another post on the forum.
As used below, would the glu functions result in a memory leak?
[/QUOTE]
Yes. In this case, the quadric object should be deleted with gluDeleteQuadric(). Alternatively …
The same quadric could be used for the lifetime of the program, with the pointer stored in a global variable or “static” local variable. E.g.