From 8a03bd510f4e680022e4ee20768eb117471e1801 Mon Sep 17 00:00:00 2001 From: liujiake Date: Tue, 18 Feb 2025 10:54:03 +0800 Subject: [PATCH] =?UTF-8?q?OH=5FNativeImage=5FDestroy=E4=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=87=8A=E6=94=BEOHNativeWindow=E6=8C=87=E9=92=88?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E5=86=8D=E6=89=8B=E5=8A=A8=E9=87=8A=E6=94=BE?= =?UTF-8?q?,=E9=81=BF=E5=85=8D=E5=8F=AF=E8=83=BD=E7=9A=84=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E5=B7=B2=E9=87=8A=E6=94=BE=E5=86=85=E5=AD=98=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liujiake --- shell/platform/ohos/ohos_external_texture_gl.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/shell/platform/ohos/ohos_external_texture_gl.cpp b/shell/platform/ohos/ohos_external_texture_gl.cpp index e369bd0689..8d993a806c 100755 --- a/shell/platform/ohos/ohos_external_texture_gl.cpp +++ b/shell/platform/ohos/ohos_external_texture_gl.cpp @@ -442,9 +442,6 @@ void OHOSExternalTextureGL::Detach() OH_NativeImage_UnsetOnFrameAvailableListener(nativeImage_); OH_NativeImage_Destroy(&nativeImage_); nativeImage_ = nullptr; - } - if (nativeWindow_ != nullptr) { - OH_NativeWindow_DestroyNativeWindow(nativeWindow_); nativeWindow_ = nullptr; } @@ -454,11 +451,9 @@ void OHOSExternalTextureGL::Detach() } OH_NativeImage_Destroy(&backGroundNativeImage_); backGroundNativeImage_ = nullptr; - } - if (backGroundNativeWindow_ != nullptr) { - OH_NativeWindow_DestroyNativeWindow(backGroundNativeWindow_); backGroundNativeWindow_ = nullptr; } + if (state_ == AttachmentState::attached) { glDeleteTextures(1, &texture_name_); glDeleteTextures(1, &backGroundTextureName_); -- Gitee