summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/wasm/qwasmwindow.h
diff options
context:
space:
mode:
authorMorten Sørvig <[email protected]>2025-02-28 20:09:00 +0100
committerMorten Sørvig <[email protected]>2025-04-25 18:14:23 +0200
commitf4287c4531d4bede3347df37168c3e19f3d25e89 (patch)
treef12f7b49d479a525be0e4bd04e3d668f68efb021 /src/plugins/platforms/wasm/qwasmwindow.h
parentd4efce2119ed1967d7b2ba8e5ae5d8571ea68906 (diff)
wasm: fix clipboard event handler leaks
Use QWasmEventHandler instead of calling addEventListener() directly (using QWasmEventHandler also allows supporting JSPI). The QWasmEventHandler destructor calls removeEventListener(), which should make sure everything gets cleaned up. Keep the Chrome-specific global (document) event handler code path, but register once at startup instead of once per window. Change-Id: If4314df738afc0dcfdb0f6f1ab9e1f176e1812ac Reviewed-by: Morten Johan Sørvig <[email protected]>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmwindow.h')
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/wasm/qwasmwindow.h b/src/plugins/platforms/wasm/qwasmwindow.h
index c77bfae3cb2..67a3e8ea293 100644
--- a/src/plugins/platforms/wasm/qwasmwindow.h
+++ b/src/plugins/platforms/wasm/qwasmwindow.h
@@ -173,6 +173,10 @@ private:
QMap<int, QWindowSystemInterface::TouchPoint> m_pointerIdToTouchPoints;
+ QWasmEventHandler m_cutCallback;
+ QWasmEventHandler m_copyCallback;
+ QWasmEventHandler m_pasteCallback;
+
Qt::WindowStates m_state = Qt::WindowNoState;
Qt::WindowStates m_previousWindowState = Qt::WindowNoState;