From 6d0706bcaa6d54354e416174e3d2654a2bff81fe Mon Sep 17 00:00:00 2001 From: mesonium Date: Wed, 5 Aug 2026 12:46:52 +0200 Subject: Fix use-after-free in Idle callback closure Replace Idle.add_once() with Idle.add() to avoid incorrect closure lifetime handling in Vala 0.56.18, which caused captured lambda data to be freed before callback execution. This is already fixed upstream in Vala 0.56.19. --- main/src/ui/conversation_content_view/conversation_view.vala | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main/src/ui/conversation_content_view/conversation_view.vala b/main/src/ui/conversation_content_view/conversation_view.vala index e8015698..6a686f1b 100644 --- a/main/src/ui/conversation_content_view/conversation_view.vala +++ b/main/src/ui/conversation_content_view/conversation_view.vala @@ -309,7 +309,7 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug } } start_load_new_conversation(); - Idle.add_once(() => { + Idle.add(() => { initialize_for_conversation_(conversation); ContentItem? content_item = null; if (!go_to_end && conversation.read_up_to_item > 0) { @@ -324,7 +324,12 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug // Scroll to end ensure_scroll_to_end(false); } - Idle.add_once(finish_load_new_conversation); + Idle.add(() => { + finish_load_new_conversation(); + return Source.REMOVE; + }); + + return Source.REMOVE; }); } -- cgit v1.3