Re: NEED HELP: My program dies only on Onyx

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++sgi.com)
Wed, 20 May 1998 10:57:22 -0700


Marcus Barnes wrote:
>
> On May 20, 10:11am, TaiSun kang wrote:
> >I suspect that textures are not freed well on Onyx.
> >Running program with scene descriptions files wit no textures
> >worked well. I am freeing textures with codes like
> >
> > pfDelete( tex );
> > if ( tex->getRef() == 0 )
> ^^^
> You are accessing potentially free memory here.
>
> > {
> > tex->freeImage();
> > tex->apply();
> > }
>
> Change this to:
>
> if ( tex->getRef() == 0 )
> {
> tex->freeImage();
> tex->apply();
> pfDelete( tex );
> }
>

You probably don't want to call apply.
You are effectively deleting the currently bound texture.
Maybe something elegant happens but it seems like the wrong
thing to do (without checking Performer internals).

Cheers,Angus.

-- 
"Only the mediocre are always at their best." -- Jean Giraudoux 

For advanced 3D graphics Performer + OpenGL based examples and tutors: http://www.dorbie.com/ ======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:25 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.