Fix crash that could occur if closing the usercard quickly after blocking (#4711)
* Specifically, this adds a caller to the network request, which makes the success or failure callback not fire. This has the unintended consequence of the block list not reloading if the usercard is closed, but it's not a big concern. * Add unrelated `-DUSE_ALTERNATE_LINKER` cmake option From https://github.com/heavyai/heavydb/blob/0517d99b467806f6af7b4c969e351368a667497d/CMakeLists.txt#L87-L103
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include <QDesktopServices>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkReply>
|
||||
#include <QPointer>
|
||||
|
||||
const QString TEXT_FOLLOWERS("Followers: %1");
|
||||
const QString TEXT_CREATED("Created: %1");
|
||||
@@ -593,7 +594,7 @@ void UserInfoPopup::installEvents()
|
||||
this->ui_.block->setEnabled(false);
|
||||
|
||||
getApp()->accounts->twitch.getCurrent()->unblockUser(
|
||||
this->userId_,
|
||||
this->userId_, this,
|
||||
[this, reenableBlockCheckbox, currentUser] {
|
||||
this->channel_->addMessage(makeSystemMessage(
|
||||
QString("You successfully unblocked user %1")
|
||||
@@ -620,7 +621,7 @@ void UserInfoPopup::installEvents()
|
||||
this->ui_.block->setEnabled(false);
|
||||
|
||||
getApp()->accounts->twitch.getCurrent()->blockUser(
|
||||
this->userId_,
|
||||
this->userId_, this,
|
||||
[this, reenableBlockCheckbox, currentUser] {
|
||||
this->channel_->addMessage(makeSystemMessage(
|
||||
QString("You successfully blocked user %1")
|
||||
|
||||
Reference in New Issue
Block a user