Prefer holding a reference to an object we're going to call

Summary: It's more correct and fixes a warning

Reviewers: #kwin, zzag

Reviewed By: #kwin, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28430
This commit is contained in:
Aleix Pol 2020-03-30 13:43:34 +02:00
parent 7db9129521
commit 27634d00c0

View file

@ -780,7 +780,7 @@ void XdgShellClient::changeMaximize(bool horizontal, bool vertical, bool adjust)
// call into decoration update borders
if (isDecorated() && decoration()->client() && !(options->borderlessMaximizedWindows() && m_requestedMaximizeMode == KWin::MaximizeFull)) {
changeMaximizeRecursion = true;
const auto c = decoration()->client().data();
const auto c = decoration()->client().toStrongRef();
if ((m_requestedMaximizeMode & MaximizeVertical) != (oldMode & MaximizeVertical)) {
emit c->maximizedVerticallyChanged(m_requestedMaximizeMode & MaximizeVertical);
}