Fix an overall crash on safe connections management:
Let some time to check members destructions after connection destruction.
This commit is contained in:
parent
704431d63f
commit
fe453b2f7d
1 changed files with 8 additions and 5 deletions
|
|
@ -74,11 +74,14 @@ public:
|
||||||
}
|
}
|
||||||
~SafeConnection() {
|
~SafeConnection() {
|
||||||
mLocker.lock();
|
mLocker.lock();
|
||||||
if (mCore.mCountRef != 0 || mModel.mCountRef != 0)
|
if (mModel.mCountRef != 0)
|
||||||
lCritical() << "[SafeConnection] Destruction while still having references. CoreRef=" << mCore.mCountRef
|
QTimer::singleShot(1000, mModel.get(), []() {
|
||||||
<< "ModelRef=" << mModel.mCountRef;
|
lCritical() << "[SafeConnection] Destroyed 1s ago but a Model is still in memory";
|
||||||
mCore.reset();
|
});
|
||||||
mModel.reset();
|
if (mCore.mCountRef != 0)
|
||||||
|
QTimer::singleShot(1000, mCore.get(), []() {
|
||||||
|
lCritical() << "[SafeConnection] Destroyed 1s ago but a Core is still in memory";
|
||||||
|
});
|
||||||
mLocker.unlock();
|
mLocker.unlock();
|
||||||
}
|
}
|
||||||
SafeSharedPointer<A> mCore;
|
SafeSharedPointer<A> mCore;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue