开发者

gluNewQuadric leaking memory

开发者 https://www.devze.com 2023-03-19 10:16 出处:网络
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.

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开发者_Go百科 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?


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:

  • Creating a 3D sphere in Opengl using Visual C++

  • How to animate a solid sphere over a curve

0

精彩评论

暂无评论...
验证码 换一张
取 消