prevent reference cycles between Java and native objects

This commit is contained in:
Julian Winkler
2024-07-26 21:47:08 +02:00
parent 45801d8f17
commit e3c0931714
30 changed files with 257 additions and 181 deletions

View File

@@ -46,9 +46,16 @@ public class Window {
}
public void setContentView(View view) {
if (contentView != view) {
if (contentView != null)
contentView.onDetachedFromWindow();
if (view != null)
view.onAttachedToWindow();
}
contentView = view;
view.onAttachedToWindow();
set_widget_as_root(native_window, view.widget);
if (view != null) {
set_widget_as_root(native_window, view.widget);
}
}
public View getDecorView() {