fix: add destroy() and signal cleanup across widgets, fix settings window + menu regressions
P0 leak fixes: context/action menus destroyed on deactivate, config callbacks unregistered in settings widgets, recorder and server signal IDs stored and disconnected, bluetooth client closed and unsubscribed, rfkill timer removed, seek timers cancelled, dropdown and options menus freed, app name cache LRU-bounded. Fix desktop 'Edit Widgets' and settings menu regressions by deferring destroy out of Gtk signal handlers via GLib.idle_add. Fix settings entry fields by connecting the activate signal explicitly (Enter saves the value).
This commit is contained in:
13 files changed
+180
-44
No files matched your search
@@ -284,6 +284,7 @@ class BluetoothDeviceSlot(Box):
|
||||
menu.append(item_remove)
|
||||
|
||||
menu.show_all()
|
||||
menu.connect("deactivate", lambda m: GLib.idle_add(m.destroy))
|
||||
menu.popup_at_pointer(event)
|
||||
return True
|
||||
|
||||
@@ -661,6 +662,11 @@ class BluetoothConnections(PullToRefreshMixin, Box):
|
||||
f"[Bluetooth] Failed to disconnect client signal {sig_id}: {e}"
|
||||
)
|
||||
self._client_signal_ids.clear()
|
||||
if self.client:
|
||||
try:
|
||||
self.client.close()
|
||||
except Exception as e:
|
||||
logger.error(f"[Bluetooth] Failed to close client: {e}")
|
||||
|
||||
def close_bluetooth(self):
|
||||
"""Called when Bluetooth panel is being closed"""
|
||||
|
||||
@@ -460,6 +460,12 @@ class PlayerBox(Box):
|
||||
def destroy(self):
|
||||
self.exit = True
|
||||
self.suspend()
|
||||
if self._seek_timeout:
|
||||
GLib.source_remove(self._seek_timeout)
|
||||
self._seek_timeout = None
|
||||
if self._debounce_seek:
|
||||
GLib.source_remove(self._debounce_seek)
|
||||
self._debounce_seek = None
|
||||
for obj, handler_id in self._signal_connections:
|
||||
try:
|
||||
obj.disconnect(handler_id)
|
||||
|
||||
Reference in new issue
Block a user