From b8c3ea8b304130c469ba7d2790662af256be48b0 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Fri, 15 Jan 2021 08:20:48 +0100 Subject: [PATCH] LibGUI: Hold on to notification icon until NotificationServer responds This broke when switching IPC messages to support move-only types. This pattern is not ideal, but the real fix for this will be using fd passing instead of shbufs. Fixes #4955. --- Userland/Libraries/LibGUI/Notification.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGUI/Notification.cpp b/Userland/Libraries/LibGUI/Notification.cpp index 2dc4fa2149..a2e07f475e 100644 --- a/Userland/Libraries/LibGUI/Notification.cpp +++ b/Userland/Libraries/LibGUI/Notification.cpp @@ -60,7 +60,8 @@ Notification::~Notification() void Notification::show() { auto connection = NotificationServerConnection::construct(); - connection->send_sync(m_text, m_title, m_icon ? m_icon->to_shareable_bitmap(connection->server_pid()) : Gfx::ShareableBitmap()); + auto icon = m_icon ? m_icon->to_shareable_bitmap(connection->server_pid()) : Gfx::ShareableBitmap(); + connection->send_sync(m_text, m_title, icon); } }