summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2023-12-15 08:57:47 +0000
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-12-21 12:26:22 +0000
commitf5bcf869810fee9882cbd1d7208e625862724259 (patch)
tree635ab1bf9d30978a7ed1a25eb008f4a48191cbff
parente5fe8e08ec8797295d970c1b1db2fa33f53d7aa2 (diff)
client: Clean up text input proxy object in textinputv2
This not only cleans up a tiny amount of memory, but also fixes a potential crash if a wayland event were to arrive on the object after the Qt level wrapper is destroyed. Pick-to: 6.6 6.5 Change-Id: I6fafdd848d61da893304c4467a57b52d3771c508 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 18166784fda5b3afce55bf00227f77e08ff08ac2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/client/qwaylandtextinputv2.cpp1
-rw-r--r--tests/auto/client/shared/textinput.cpp3
2 files changed, 2 insertions, 2 deletions
diff --git a/src/client/qwaylandtextinputv2.cpp b/src/client/qwaylandtextinputv2.cpp
index a799793e5..89a8a6d77 100644
--- a/src/client/qwaylandtextinputv2.cpp
+++ b/src/client/qwaylandtextinputv2.cpp
@@ -46,6 +46,7 @@ QWaylandTextInputv2::~QWaylandTextInputv2()
{
if (m_resetCallback)
wl_callback_destroy(m_resetCallback);
+ destroy();
}
void QWaylandTextInputv2::reset()
diff --git a/tests/auto/client/shared/textinput.cpp b/tests/auto/client/shared/textinput.cpp
index 05889687c..ee7e9ff9b 100644
--- a/tests/auto/client/shared/textinput.cpp
+++ b/tests/auto/client/shared/textinput.cpp
@@ -12,9 +12,8 @@ TextInputManager::TextInputManager(CoreCompositor *compositor)
void TextInputManager::zwp_text_input_manager_v2_get_text_input(Resource *resource, uint32_t id, wl_resource *seatResource)
{
- Q_UNUSED(resource);
- Q_UNUSED(id);
Q_UNUSED(seatResource);
+ add(resource->client(), id, resource->version());
}
} // namespace MockCompositor