diff options
| author | mesonium <mesonium@posteo.eu> | 2026-08-05 12:46:52 +0200 |
|---|---|---|
| committer | Marvin W <git@larma.de> | 2026-08-05 05:38:17 -0700 |
| commit | 6d0706bcaa6d54354e416174e3d2654a2bff81fe (patch) | |
| tree | 827a604b4467395f3b6fdcb25f2b18c60eb42537 | |
| parent | baea5162d4a855d2ae1ad630ed65861c8faac0e7 (diff) | |
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.
| -rw-r--r-- | main/src/ui/conversation_content_view/conversation_view.vala | 9 |
1 files 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; }); } |
