diff --git a/entry/src/main/cpp/sample/recorder/Recorder.cpp b/entry/src/main/cpp/sample/recorder/Recorder.cpp index 13337caf682ef5bc9142fd536b71af843728b12d..2688b3fbf536b384e66de76e02a2424006fdc24b 100644 --- a/entry/src/main/cpp/sample/recorder/Recorder.cpp +++ b/entry/src/main/cpp/sample/recorder/Recorder.cpp @@ -137,6 +137,10 @@ void Recorder::Release() { } if (videoEncoder_ != nullptr) { videoEncoder_->Stop(); + if (sampleInfo_.window != nullptr) { + OH_NativeWindow_DestroyNativeWindow(sampleInfo_.window); + sampleInfo_.window = nullptr; + } videoEncoder_->Release(); videoEncoder_.reset(); AVCODEC_SAMPLE_LOGI("Video encoder release successful");