From b7d7538494db8278dca44c63c21710059dc7774f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 29 Sep 2021 10:27:34 +0200 Subject: Fix use after delete with self assignment Not sure this is actually used. Discovered in static analyzer Change-Id: I1c143002e5da1ec809887626e348ea08a74b3715 Reviewed-by: Kirill Burtsev (cherry picked from commit f2dcaabd5972f8f8eb7251895c06feac4bb0f939) Reviewed-by: Qt Cherry-pick Bot --- src/core/native_web_keyboard_event_qt.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3