Merge pull request #8182 from hughbe/runtime-attribute-refcnt