Fixes memory leak on setResourcePath

Thanks Xcode -> Analize