Skip to content

Commit

Permalink
QWindow: use std::exchange when ... exchanging values
Browse files Browse the repository at this point in the history
Replaces a three-liner with a more elegant, idiomatic one-liner.

Pick-to: 6.3
Change-Id: I57fbe5d808dffa44f6fceffb97c47f0c84ccd3df
Reviewed-by: Volker Hilsheimer <[email protected]>
Reviewed-by: Tor Arne Vestbø <[email protected]>
  • Loading branch information
marcmutz authored and vohi committed Dec 30, 2021
1 parent c064b6b commit c760fba
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/gui/kernel/qwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2002,9 +2002,7 @@ void QWindowPrivate::destroy()
// Unset platformWindow before deleting, so that the destructor of the
// platform window does not recurse back into the platform window via
// this window during destruction (e.g. as a result of platform events).
QPlatformWindow *pw = platformWindow;
platformWindow = nullptr;
delete pw;
delete std::exchange(platformWindow, nullptr);

if (QGuiApplicationPrivate::focus_window == q)
QGuiApplicationPrivate::focus_window = q->parent();
Expand Down

0 comments on commit c760fba

Please sign in to comment.