You should use IOUtil::closeResource