mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
fix segfault on disconnect (#5447)
* add new param to closeRequest * don't emit signals in dtors * send closeRequest * fix build failure * fix build failure * see if we can get away with the overloaded triggered * fix build failure
This commit is contained in:
parent
3b544a36a8
commit
7347ba88ac
12 changed files with 59 additions and 67 deletions
|
|
@ -101,7 +101,7 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor,
|
|||
hbox->addWidget(userList, 1);
|
||||
|
||||
aLeaveRoom = new QAction(this);
|
||||
connect(aLeaveRoom, SIGNAL(triggered()), this, SLOT(actLeaveRoom()));
|
||||
connect(aLeaveRoom, &QAction::triggered, this, [this] { closeRequest(); });
|
||||
|
||||
roomMenu = new QMenu(this);
|
||||
roomMenu->addAction(aLeaveRoom);
|
||||
|
|
@ -135,11 +135,6 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor,
|
|||
setCentralWidget(mainWidget);
|
||||
}
|
||||
|
||||
TabRoom::~TabRoom()
|
||||
{
|
||||
emit roomClosing(this);
|
||||
}
|
||||
|
||||
void TabRoom::retranslateUi()
|
||||
{
|
||||
gameSelector->retranslateUi();
|
||||
|
|
@ -175,9 +170,11 @@ void TabRoom::actShowPopup(const QString &message)
|
|||
}
|
||||
}
|
||||
|
||||
void TabRoom::closeRequest()
|
||||
void TabRoom::closeRequest(bool /*forced*/)
|
||||
{
|
||||
actLeaveRoom();
|
||||
sendRoomCommand(prepareRoomCommand(Command_LeaveRoom()));
|
||||
emit roomClosing(this);
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void TabRoom::tabActivated()
|
||||
|
|
@ -216,12 +213,6 @@ void TabRoom::sayFinished(const Response &response)
|
|||
chatView->appendMessage(tr("You are flooding the chat. Please wait a couple of seconds."));
|
||||
}
|
||||
|
||||
void TabRoom::actLeaveRoom()
|
||||
{
|
||||
sendRoomCommand(prepareRoomCommand(Command_LeaveRoom()));
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void TabRoom::actClearChat()
|
||||
{
|
||||
chatView->clearChat();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue