From fb799e3ba8313ff2da53d9d5c34f8421f164cbf1 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Mon, 27 Feb 2023 23:38:31 +0100 Subject: Fix some memory leaks --- main/src/ui/conversation_content_view/file_widget.vala | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'main/src/ui/conversation_content_view/file_widget.vala') diff --git a/main/src/ui/conversation_content_view/file_widget.vala b/main/src/ui/conversation_content_view/file_widget.vala index 543eb169..785acf7d 100644 --- a/main/src/ui/conversation_content_view/file_widget.vala +++ b/main/src/ui/conversation_content_view/file_widget.vala @@ -135,6 +135,17 @@ public class FileWidget : SizeRequestBox { } return false; } + + public override void dispose() { + if (default_widget_controller != null) default_widget_controller.dispose(); + default_widget_controller = null; + if (content != null) { + content.unparent(); + content.dispose(); + content = null; + } + base.dispose(); + } } public class FileWidgetController : Object { -- cgit v1.2.3-54-g00ecf