From 6f47d44b81199bd626c121ad3b436aa7798072a6 Mon Sep 17 00:00:00 2001 From: rh101 Date: Mon, 26 Apr 2021 15:46:59 +1000 Subject: [PATCH] Clear unique_ptr with reset(). --- cocos/audio/src/AudioDecoderWav.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/audio/src/AudioDecoderWav.cpp b/cocos/audio/src/AudioDecoderWav.cpp index d89dcdbe3a..b1d7acb40b 100644 --- a/cocos/audio/src/AudioDecoderWav.cpp +++ b/cocos/audio/src/AudioDecoderWav.cpp @@ -132,13 +132,13 @@ namespace cocos2d { if (!IsEqualGUID(fmtInfo.ExtParams.SubFormat, WAV_SUBTYPE_PCM) && !IsEqualGUID(fmtInfo.ExtParams.SubFormat, WAV_SUBTYPE_IEEE_FLOAT)) { - fileStream = nullptr; + fileStream.reset(); return false; } break; default: ALOGW("The wav format %d doesn't supported currently!", (int)fmtInfo.AudioFormat); - fileStream = nullptr; + fileStream.reset(); assert(false); return false; }