[tools] add a way to clear object references