[Kde-bindings] playground/bindings/kimono

Richard Dale richard.j.dale at gmail.com
Thu Feb 8 22:35:28 UTC 2007


On Thursday 08 February 2007, Arno Rehn wrote:
> Am Donnerstag, 8. Februar 2007 schrieb Richard Dale:
> > SVN commit 631668 by rdale:
> >
> > * Added a first attempt at setting up the strongReferenceMap and calling
> >   destructors. A boolean function CreateStrongReference() checks whether
> >   or not a strong reference is needed when a new instance has been
> >   constructed. Another function is needed to checked whether the C++
> >   instance still has a parent or container, and not delete if it has.
>
> Uhm, just an idea: why don't we use a strongReference map instead of the
> weakRef one? Would that create any difficulties? When a C++ instance is
> created, a C# reference is added to this map. If there's another one in the
> code, set by the user, that's fine, wouldn't matter. The C# reference in
> the 'normal' code is deleted, it wouldn't matter, we still have the one in
> the map. When finally the C++ instance gets delted we can remove the C#
> reference from the map and let the GC do its work.
> That would be a lot easier than taking care of two reference maps, one with
> strong and one with weak references, wouldn't it?
Yes it is a problem as everything in the strong reference map is only deleted
if the containing instance deletes its children. So that means that instances
which don't have a parent/owner instance will never be deleted.

-- Richard



More information about the Kde-bindings mailing list