To me, using weakref  and removing the stale entry seems fine.