faif / python-patterns

A collection of design patterns/idioms in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

behavioral Registry keeps direct references of instances preventing garbage collection

Dalvenjia opened this issue · comments

By keeping a direct reference of the instances as the values in the registry dict the garbage collector will never dispose off of otherwise unreferenced instances, you can use weak references to prevent this, and maybe add some scheduled cleaning of deleted instances.

I can make a PR if you want

My bad, the class objects are being saved, not instances... closing this