new weakref implementation.

for [Feature #6309]