Re: Refcounting craziness



On 24 Jan 2001, Havoc Pennington wrote:
> Well, the specific horror pointed out was a roundabout way of writing:
>
>  while (object->ref_count)
>    unref (object);
     
        Please do point it out again, either way the original module
pointed at been substantialy re-written. The above seems rather strange.

        I can believe we were keeping a non-reffed copy and listening on  
the destroy signal to maintain a copy without creating reference loops, I
don't recollect anything quite so dumb as:

        while (use_memory_that_might_have_just_been_freed->ref)
                unref (use_memory_that_might_have_just_been_freed->ref);

        Indeed; I suspect that unless the use case you outline is
extremely unlikely that I would see this all the time with memory
debugging turned on.

	Either way, we see a lot more reference counting issues in bonobo
because we are not dealing with the rather trivial issue of a simple,
single tree widget hierarchy but rather a complex network of references
and mutual references.

        Regards,
  
                Michael.

-- 
 mmeeks gnu org  <><, Pseudo Engineer, itinerant idiot





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]