Fixed memory leak in online toaster. The avatar data was not deleted, when the online toaster is deaktivated.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3897 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-12-05 22:27:50 +00:00
parent 38203704f0
commit a79d2a8e53

View File

@ -422,21 +422,19 @@ void NotifyQt::UpdateGUI()
{ {
OnlineToaster * onlineToaster = new OnlineToaster(); OnlineToaster * onlineToaster = new OnlineToaster();
onlineToaster->setMessage(QString::fromStdString(realmsg)); onlineToaster->setMessage(QString::fromStdString(realmsg));
if(size != 0)
{
// set the image
QPixmap pix ;
pix.loadFromData(data,size,"PNG") ;
onlineToaster->setPixmap(pix);
delete[] data ;
} if(size != 0)
else {
{ // set the image
onlineToaster->setPixmap(QPixmap(":/images/user/personal64.png")); QPixmap pix ;
} pix.loadFromData(data,size,"PNG") ;
onlineToaster->setPixmap(pix);
}
else
{
onlineToaster->setPixmap(QPixmap(":/images/user/personal64.png"));
}
onlineToaster->show(); onlineToaster->show();
onlineToaster->play(); onlineToaster->play();
} }
@ -449,6 +447,10 @@ void NotifyQt::UpdateGUI()
} }
break; break;
} }
if (data) {
delete[] data;
}
} }
if (rsNotify->NotifySysMessage(sysid, type, title, msg)) if (rsNotify->NotifySysMessage(sysid, type, title, msg))