Re: hmmm.... db.c:free_char()

From: Stephen Wolfe (siv@CYBERENET.NET)
Date: 08/07/98


> >At the very end of this function, is there any reason not to do a ch=NULL;
> >right have the free(ch); call?  I think this might be a nice way to ensure
> >consistancy.  But for that DT and fast aggr problem, you need to check to
> >see if(ch && ch->in_room)

since everyone explained why it wouldn't work, but didn't provide a
solution, here's one..just make a macro like:

#define FREE(var)       do {            \
                          free(var);    \
                          var = NULL;   \
                        } while (0)

and replace all free() calls with FREE()..

siv


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST