diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-09-29 10:27:34 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-09-30 16:32:33 +0000 |
commit | b7d7538494db8278dca44c63c21710059dc7774f (patch) | |
tree | c6193dacc465d75e213d0b4b1b76410f875c847e /src | |
parent | 7a03f9939d200568ba2322c18680366b7c1760e1 (diff) |
Fix use after delete with self assignment
Not sure this is actually used. Discovered in static analyzer
Change-Id: I1c143002e5da1ec809887626e348ea08a74b3715
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
(cherry picked from commit f2dcaabd5972f8f8eb7251895c06feac4bb0f939)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/native_web_keyboard_event_qt.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/native_web_keyboard_event_qt.cpp b/src/core/native_web_keyboard_event_qt.cpp index edd27ccec..c90b3c9e8 100644 --- a/src/core/native_web_keyboard_event_qt.cpp +++ b/src/core/native_web_keyboard_event_qt.cpp @@ -95,7 +95,10 @@ NativeWebKeyboardEvent::NativeWebKeyboardEvent(const NativeWebKeyboardEvent& oth { } -NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=(const NativeWebKeyboardEvent& other) { +NativeWebKeyboardEvent &NativeWebKeyboardEvent::operator=(const NativeWebKeyboardEvent &other) +{ + if (this == &other) + return *this; WebKeyboardEvent::operator=(other); DestroyEvent(os_event); os_event = CopyEvent(other.os_event); |