diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-16 20:44:49 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-16 20:46:44 +0200 |
commit | 5f0d24cab2fa18408b63a0e116e2e349710b1c73 (patch) | |
tree | fd469c868355e6d0e39af01a6dfee74efb69d862 /Libraries | |
parent | 6d27915f4b8ee882cfc820f362c2ae6aa46f0aaa (diff) | |
download | serenity-5f0d24cab2fa18408b63a0e116e2e349710b1c73.zip |
LibGUI: Turn a heap-allocated event into a stack-allocated one
Diffstat (limited to 'Libraries')
-rw-r--r-- | Libraries/LibGUI/Window.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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<PaintEvent>(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); |