Keeping track of reference counts and if an object got freed