Re: [code] Question on correctly freeing memory.

From: Skylar (skylar@ifconfig.intserv.com)
Date: 09/13/96


On Thu, 12 Sep 1996, Gary Barnett wrote:

> I am working on having customized object descriptions save with the objects in
> the rent system. I have the code working correcty, but am not sure of the correct
> way to free the memory in use before assigning the new description. Here is
> the relevant code.. Any thoughts on how to plug the resulting memory leak will
> be most appreciated:

What makes you think theres a memory leak?  As far as I can see, in pl11, the
free_obj() function in db.c (which is called from extract_obj() in handler.c)
checks if the descriptions are pointers to the prototype obj's description,
and if they're not it free's them... as it should be, else you'll be freeing
up the descriptions of all objs of that num... this should peacefully work
with what you've done and handle all the free'ing on its own...


-Sky

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



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