gluNewQuadric leaking memory

2019-08-31 00:59发布

When I checked my Application for leak with Instruments (X-Code Tool, I program in objective-c), I saw the #living "malloc 48 bytes" allocations growing bigger and bigger. Also, Instruments does say that it leaks there. If I check for the Responsible caller, it always says "gluNewQuadric". I checked the internet for a bit and found some people are having the same complaints, but not too many, and I also found no working solution. I also put

glutInit(&argc, argv);

in "main.m", and the increase of #living seems to have gone down a bit, but is still growing persistently. The only place where I use glu is with

glutSolidSphere
glutWireSphere

Any suggestions on how to fix this?

1条回答
仙女界的扛把子
2楼-- · 2019-08-31 01:37

Here's a pro-tipp: Don't use GLUT rendering primitives. They are there for quick testing and not meant for serious bussines. A few weeks ago I posted two lengthy answers on how to draw a sphere using pure OpenGL without resorting to GLU or GLUT:

查看更多
登录 后发表回答