Mail Archives: djgpp/1999/08/25/21:14:22
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*
- Raw text -