From: uhfgood AT aol DOT com (Uhfgood) Newsgroups: comp.os.msdos.djgpp Subject: Re: -KWII- Allegro and RLE sprites Lines: 35 NNTP-Posting-Host: ladder03.news.aol.com X-Admin: news AT aol DOT com Date: 16 Feb 1999 16:29:17 GMT Organization: AOL http://www.aol.com References: <8D53104ECD0CD211AF4000A0C9D60AE3535870 AT probe-2 DOT acclaim-euro DOT net> Message-ID: <19990216112917.21437.00001938@ng150.aol.com> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com You said it was a bad idea to do this. But is it still a bad idea, when I have the RLE_SPRITE *jumpman[ 12 ]; declaration? didn't I just make allegro set aside extra memory for those rle sprites before I aliased them? -Keith >> Then at the end of my program i have a loop to destroy the >> sprites like this: >> for( c = 0; c < 12; c++ ) >> destroy_rle_sprites( jumpman[ c ] ); > >Bad idea. The datafile routines are in charge of allocating and freeing >memory: you shouldn't go anywhere near this yourself. You've just >copied the address of the sprite objects, not the object itself, so >you don't own it and should try to destroy it. Use unload_datafile() >when you want to free up the memory. Actually, I'm surprised that >it doesn't crash when you reach this code! > > > Shawn Hargreaves. > > > > > > > *Keith Weatherby II* *Uhfgood AT aol DOT com* *Vice AT gconn DOT com*