Fixed memory leak when using tray menu of chat lobby and removed double connect of signals

This commit is contained in:
thunder2 2023-12-28 17:05:29 +01:00
parent 73f1da20f0
commit f00e8ba18e
3 changed files with 13 additions and 19 deletions

View file

@ -982,11 +982,12 @@ void ChatWidget::on_notifyButton_clicked()
if(!notify) return;
if (chatType() != CHATTYPE_LOBBY) return;
QMenu* menu = new QMenu(MainWindow::getInstance());
QMenu* menu = notify->createMenu();
QIcon icoLobby=(ui->notifyButton->icon());
notify->makeSubMenu(menu, icoLobby, title, chatId.toLobbyId());
menu->exec(ui->notifyButton->mapToGlobal(QPoint(0,ui->notifyButton->geometry().height())));
delete(menu);
}