octave-maintainers
[Top][All Lists]
Advanced

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

Re: Graphics properties as objects


From: Michael Goffioul
Subject: Re: Graphics properties as objects
Date: Sun, 6 Jan 2008 10:43:01 +0100

On 1/6/08, John W. Eaton <address@hidden> wrote:
> Maybe I'm missing something fundamental, but I don't understand why
> there would be a memory leak if the map contains values.  Can you give
> a simple example that shows why that would happen?

It would not leak the "property" object, but the underlying "rep" field,
which is a pointer. For fixed properties, that's not a problem, because
the rep points to some field of graphics_object, so it will be destroyed
with the containing object. However, for dynamic properties, this won't
be the case. In my understanding, adding a dynamic property would
be equivalent to something like:

    all_props["my_property"] = property (new string_property (...));

But you need someone responsible for deleting the string_property
object. That's why I thought about reference counting, as used elsewhere
in octave.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]