POV-Ray : Newsgroups : povray.programming : and another one, possible memory leak : Re: and another one, possible memory leak Server Time
28 Jun 2024 02:08:08 EDT (-0400)
  Re: and another one, possible memory leak  
From: Daniel Hulme
Date: 29 Oct 2004 08:10:50
Message: <20041029131050.0357d30a@dh286.pem.cam.ac.uk>
> I did not go look at the code, but did you check that:
>  - it copy the reference count, really ?
>  - didn't it create the interior structure first, with the count set
>  to 1 during the creation.
Yes, it did both of these:
    New = Create_Interior();

    *New = *Old;

It then goes on to do some deep copying. Now, I may be mistaken, but I
was under the impression that *x = *y did a shallow copy. Since the
reference count is an int and not an int*, that means the reference
count is copied, over the existing count of 1.

Daniel

-- 
A most peculiar man    With the windows closed      And Mrs Reardon says
He died last Saturday  So he'd never wake up  He has a brother somewhere
He turned on the gas   To his silent world   Who should be notified soon
And he went to sleep   And his tiny room    .oO( http://sad.istic.org/ )


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.