mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 23:33:58 +08:00
Revert "ui: fix dialog memory leak" (#36787)
Revert "ui: fix dialog memory leak (#36767)"
This reverts commit 45b7d60263.
This commit is contained in:
@@ -40,11 +40,6 @@ class BigDialogBase(NavWidget, abc.ABC):
|
||||
# move to right side
|
||||
self._right_btn._rect.x = self._rect.x + self._rect.width - self._right_btn._rect.width
|
||||
|
||||
def hide_event(self):
|
||||
# Free reference to self to allow refcount to go to zero
|
||||
super().hide_event()
|
||||
self.set_back_callback(None)
|
||||
|
||||
def _render(self, _) -> DialogResult:
|
||||
"""
|
||||
Allows `gui_app.set_modal_overlay(BigDialog(...))`.
|
||||
@@ -168,11 +163,6 @@ class BigInputDialog(BigDialogBase):
|
||||
confirm_callback(self._keyboard.text())
|
||||
self._confirm_callback = confirm_callback_wrapper
|
||||
|
||||
def hide_event(self):
|
||||
# Free reference to self to allow refcount to go to zero
|
||||
super().hide_event()
|
||||
self._confirm_callback = None
|
||||
|
||||
def _update_state(self):
|
||||
super()._update_state()
|
||||
|
||||
|
||||
@@ -252,7 +252,7 @@ class NavWidget(Widget, abc.ABC):
|
||||
def set_back_enabled(self, enabled: bool | Callable[[], bool]) -> None:
|
||||
self._back_enabled = enabled
|
||||
|
||||
def set_back_callback(self, callback: Callable[[], None] | None) -> None:
|
||||
def set_back_callback(self, callback: Callable[[], None]) -> None:
|
||||
self._back_callback = callback
|
||||
|
||||
def _handle_mouse_event(self, mouse_event: MouseEvent) -> None:
|
||||
|
||||
Reference in New Issue
Block a user