mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:18:11 +00:00
GWindow: Fix crash when calling set_rect() repeatedly.
We throw away the backing store if the window rect changes size. Since the resizing happens asynchronously at the mercy of the WindowServer, we might end up in set_rect() again before gaining a new backing store. So there are no guarantees that the back/front bitmaps exist here.
This commit is contained in:
parent
146aedc32c
commit
9ff36afeaa
1 changed files with 2 additions and 2 deletions
|
@ -144,9 +144,9 @@ void GWindow::set_rect(const Rect& a_rect)
|
|||
request.window_id = m_window_id;
|
||||
request.window.rect = a_rect;
|
||||
GEventLoop::current().post_message_to_server(request);
|
||||
if (m_back_bitmap->size() != a_rect.size())
|
||||
if (m_back_bitmap && m_back_bitmap->size() != a_rect.size())
|
||||
m_back_bitmap = nullptr;
|
||||
if (m_front_bitmap->size() != a_rect.size())
|
||||
if (m_front_bitmap && m_front_bitmap->size() != a_rect.size())
|
||||
m_front_bitmap = nullptr;
|
||||
if (m_main_widget)
|
||||
m_main_widget->resize(a_rect.size());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue