p3StatusService::getStatusQueue

- memory leak -> "RsItem* item" was not freed, when "dynamic_cast<RsStatusItem*>" failed
- optimized return of std::list as parameter and not as return. return will copy the list and its not necessary

p3StatusService::getStatus
- memory leak -> items in "std::list<RsStatusItem* > status_items" was not freed
- potential crash, when receiving a status for an unknown peer

p3Peers::getPeerDetails
- optimized - call to "AuthSSL::getAuthSSL()->OwnId()" only once
- optimized - add ip addresses directly to "d.ipAddressList"

PeersDialog::insertPeers
- fixed possible crash, when ssl child has disappeared and was removed from tree, there was a missing continue

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3125 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-06-13 12:26:23 +00:00
parent 61f2c14663
commit 0d1eaba890
5 changed files with 53 additions and 51 deletions

View file

@ -512,9 +512,11 @@ void PeersDialog::insertPeers()
continue;
}
bool bNew = false;
if (gpg_item == NULL) {
gpg_item = new MyTreeWidgetItem(peertreeWidget, 0); //set type to 0 for custom popup menu
gpg_item->setChildIndicatorPolicy(QTreeWidgetItem::DontShowIndicatorWhenChildless);
bNew = true;
}
gpg_item -> setText(COLUMN_NAME, QString::fromStdString(detail.name));
@ -565,6 +567,7 @@ void PeersDialog::insertPeers()
if (sslItem) {
gpg_item->removeChild(sslItem);
}
continue;
}
if (newChild) {
@ -733,8 +736,10 @@ void PeersDialog::insertPeers()
}
}
/* add gpg item to the list. If item is already in the list, it won't be duplicated thanks to Qt */
peertreeWidget->addTopLevelItem(gpg_item);
if (bNew) {
/* add gpg item to the list */
peertreeWidget->addTopLevelItem(gpg_item);
}
}
}