Port SlotObjectGuard to SlotObjUniquePtr

Pick-to: 6.6 6.5
Change-Id: I81e64db7e1be9076494bee15bbca372ebffeb3e0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Marc Mutz 2023-07-16 14:25:25 +02:00
parent 56651915e8
commit cec711092f

View File

@ -3769,17 +3769,14 @@ struct SlotObjectGuard {
} }
QtPrivate::QSlotObjectBase const *operator->() const QtPrivate::QSlotObjectBase const *operator->() const
{ return m_slotObject; } { return m_slotObject.get(); }
QtPrivate::QSlotObjectBase *operator->() QtPrivate::QSlotObjectBase *operator->()
{ return m_slotObject; } { return m_slotObject.get(); }
~SlotObjectGuard() { ~SlotObjectGuard() = default;
if (m_slotObject)
m_slotObject->destroyIfLastRef();
}
private: private:
QtPrivate::QSlotObjectBase *m_slotObject = nullptr; QtPrivate::SlotObjUniquePtr m_slotObject;
}; };
/*! /*!