WASM compositor, clear last mouse target if it is the removed window

m_lastMouseTargetWindow pointer may be kept even though the window
has been removed. This leads to memory access problems.

Change-Id: Ie83b607bf5a815540605671dd1d1ad37288074c5
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
This commit is contained in:
Mikolaj Boc 2022-12-02 12:53:36 +01:00
parent 9329e4e8c7
commit 310aecc94a

View File

@ -161,6 +161,8 @@ void QWasmCompositor::removeWindow(QWasmWindow *window)
{
m_requestUpdateWindows.remove(window);
m_windowStack.removeWindow(window);
if (m_lastMouseTargetWindow == window->window())
m_lastMouseTargetWindow = nullptr;
if (m_windowStack.topWindow())
m_windowStack.topWindow()->requestActivateWindow();