Re: Quick save tell snippet.

From: Patrick J. Dughi (dughi@IMAXX.NET)
Date: 04/01/98


> 1) Don't we need to check if a pointer exists before freeing it ?
> >+    if(counter==9) {
> >+      /* then we don't want the old one anymore.. */
> >>>>      if (GET_TELLS(ch,i)) free(GET_TELLS(ch,counter));
> >+    }
>
> 2) We need to add in free_char (db.c) a for cycle for freeing the allocated
> strings previous_tells...
> Am I right ???

You sure are. :)  This must have been why I didn't release it :)  Gosh,
I'm glad I had written this so long ago, else I'd be embarassed.  Curious
why it didn't crash when it tried to free a null pointer, but I'll let
that go for now.  You really ought to free up the tells when the character
quits, probably in db.c, but maybe not - I'd put it in extract_character,
but thats called when the pc dies and I'd rather keep them through it if I
were me.

                                                        PjD


     +------------------------------------------------------------+
     | 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