I prefer to use SG_UNREF/SG_REF, and make sure they are in pairs.