Please just ref the new one first, then unref old one, then overwrite. Best way. This one is indeed indeed weird and also not safe (object is estrogen if old and new are the same and recount is 1.