Mail Archives: djgpp/2000/06/29/07:03:46
Okay. This looks promising, I will definately try it.
{ ...wish I saw that earlier...}
On Thu, 29 Jun 2000 02:41:47 GMT, Sean Proctor <sproctor AT ccs DOT neu DOT edu>
wrote:
>On Wed, 28 Jun 2000 05:37:15 -0400, Radical NetSurfer
><radsmail AT juno DOT com> wrote:
>
>>2) globally, I have
>>BITMAP *da_bmp=NULL;
>>...
>>INSIDE the main module...
>>
>>da_bmp = create_bitmap(...);
>>....
>>destroy_bitmap(da_bmp);
>>da_bmp=NULL;
>>...
>>THEN INSIDE functions (locations NOT inside main),
>>I simply re-assign the Global pointer
>>da_bmp = create_bitmap(...)
>>
>>and thats is all there is to tell.
>
>that doesn't make much sense to me... when you re-assign the global
>pointer inside the fuctions you're losing what it was previously
>pointing to... so unless you have something like:
>BITMAP *tmp = da_bmp;
>da_bmp = create_bitmap(...)
>...
>destroy_bitamp(da_bmp);
>da_bmp = tmp;
>or destroy the bitmap before you reassign it... you're going to have
>unfreed memory. which I don't think would give actually errors...
>except in memory leaks... but what do I know?
>
>Sean
- Raw text -