[Kde-bindings] playground/bindings/kimono

Arno Rehn arno at arnorehn.de
Thu Feb 8 19:34:29 UTC 2007

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?

Arno Rehn
arno at arnorehn.de

More information about the Kde-bindings mailing list