this function is too complicated for the reference-count checker to fully analyze: not all paths were analyzed