Thomas Weidenmueller schrieb:
The problem is, the first reference is never removed and it is not possible to dereference (delete) the parent.
imo a key should always hold a reference to it's parent and dereference it when deleted (in the deletion callback), that would automatically delete all no longer used keys since they'd always dereference their parent, which might dereference even more keys nearer to the root key.
In this case a key object is never removed, because nobody can remove the keep-alive reference. We can use a worker thread which scans periodically the registry and dereference all key objects which have only the keep-alive reference.
- Hartmut