From 5f0d24cab2fa18408b63a0e116e2e349710b1c73 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 16 Jul 2020 20:44:49 +0200 Subject: LibGUI: Turn a heap-allocated event into a stack-allocated one --- Libraries/LibGUI/Window.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Libraries') diff --git a/Libraries/LibGUI/Window.cpp b/Libraries/LibGUI/Window.cpp index 5c5fff730b..ce7685451b 100644 --- a/Libraries/LibGUI/Window.cpp +++ b/Libraries/LibGUI/Window.cpp @@ -303,8 +303,10 @@ void Window::event(Core::Event& event) rects.append({ {}, paint_event.window_size() }); } - for (auto& rect : rects) - m_main_widget->dispatch_event(*make(rect), this); + for (auto& rect : rects) { + PaintEvent paint_event(rect); + m_main_widget->dispatch_event(paint_event, this); + } if (m_double_buffering_enabled) flip(rects); -- cgit v1.2.3