Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit d96f95a

Browse files
committed
Break the reference cycle between the surface factory and the external view embedder
See flutter/flutter#68315
1 parent ed47fc9 commit d96f95a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

shell/platform/android/platform_view_android.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ PlatformViewAndroid::PlatformViewAndroid(
107107
jni_facade_(jni_facade),
108108
platform_view_android_delegate_(jni_facade) {}
109109

110-
PlatformViewAndroid::~PlatformViewAndroid() = default;
110+
PlatformViewAndroid::~PlatformViewAndroid() {
111+
if (surface_factory_) {
112+
surface_factory_->SetExternalViewEmbedder(nullptr);
113+
}
114+
}
111115

112116
void PlatformViewAndroid::NotifyCreated(
113117
fml::RefPtr<AndroidNativeWindow> native_window) {

0 commit comments

Comments
 (0)