Fix crashes

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad
2023-09-01 12:50:20 +01:00
parent ee48766996
commit 6aecbfc38f
3 changed files with 18 additions and 7 deletions

View File

@ -33,7 +33,11 @@ class shared_qobject_ptr : public QSharedPointer<T> {
{}
void reset() { QSharedPointer<T>::reset(); }
void reset(T* other) { QSharedPointer<T>::reset(other); }
void reset(T* other)
{
shared_qobject_ptr<T> t(other);
this->swap(t);
}
void reset(const shared_qobject_ptr<T>& other)
{
shared_qobject_ptr<T> t(other);