fixed possible crash in GxsIdDetails

This commit is contained in:
Cyril Soler 2016-04-12 10:06:01 -04:00
parent d5ed84ec9d
commit cf746f160c

View File

@ -127,8 +127,8 @@ void GxsIdDetails::connectObject_locked(QObject *object, bool doConnect)
/* Search Object in pending list */
if(mPendingData.find(object) != mPendingData.end())
return ;
if(mPendingData.find(object) == mPendingData.end()) // force disconnect when not in the list
doConnect = false ;
if (doConnect) {
connect(object, SIGNAL(destroyed(QObject*)), this, SLOT(objectDestroyed(QObject*)));
@ -169,10 +169,10 @@ void GxsIdDetails::timerEvent(QTimerEvent *event)
pendingData.mCallback(GXS_ID_DETAILS_TYPE_DONE, details, pendingData.mObject, pendingData.mData);
QObject *object = pendingData.mObject;
mPendingDataIterator = mPendingData.erase(mPendingDataIterator);
connectObject_locked(object, false);
mPendingDataIterator = mPendingData.erase(mPendingDataIterator);
continue;
}
@ -182,10 +182,10 @@ void GxsIdDetails::timerEvent(QTimerEvent *event)
pendingData.mCallback(GXS_ID_DETAILS_TYPE_FAILED, details, pendingData.mObject, pendingData.mData);
QObject *object = pendingData.mObject;
mPendingDataIterator = mPendingData.erase(mPendingDataIterator);
connectObject_locked(object, false);
mPendingDataIterator = mPendingData.erase(mPendingDataIterator);
continue;
}