-
-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix crash that could occur if closing the usercard quickly after blocking #4711
Conversation
…cking or unblocking 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
@@ -121,11 +121,12 @@ void TwitchAccount::loadBlocks() | |||
}); | |||
} | |||
|
|||
void TwitchAccount::blockUser(QString userId, std::function<void()> onSuccess, | |||
void TwitchAccount::blockUser(QString userId, const QObject *caller, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the parameter 'userId' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
void TwitchAccount::blockUser(QString userId, const QObject *caller, | |
void TwitchAccount::blockUser(const QString& userId, const QObject *caller, |
src/providers/twitch/TwitchAccount.hpp:74:
- void blockUser(QString userId, const QObject *caller,
+ void blockUser(const QString& userId, const QObject *caller,
@@ -121,11 +121,12 @@ | |||
}); | |||
} | |||
|
|||
void TwitchAccount::blockUser(QString userId, std::function<void()> onSuccess, | |||
void TwitchAccount::blockUser(QString userId, const QObject *caller, | |||
std::function<void()> onSuccess, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the parameter 'onSuccess' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
std::function<void()> onSuccess, | |
const std::function<void()>& onSuccess, |
src/providers/twitch/TwitchAccount.hpp:75:
- std::function<void()> onSuccess,
+ const std::function<void()>& onSuccess,
@@ -141,11 +142,12 @@ | |||
std::move(onFailure)); | |||
} | |||
|
|||
void TwitchAccount::unblockUser(QString userId, std::function<void()> onSuccess, | |||
void TwitchAccount::unblockUser(QString userId, const QObject *caller, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the parameter 'userId' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
void TwitchAccount::unblockUser(QString userId, const QObject *caller, | |
void TwitchAccount::unblockUser(const QString& userId, const QObject *caller, |
src/providers/twitch/TwitchAccount.hpp:77:
- void unblockUser(QString userId, const QObject *caller,
+ void unblockUser(const QString& userId, const QObject *caller,
@@ -141,11 +142,12 @@ | |||
std::move(onFailure)); | |||
} | |||
|
|||
void TwitchAccount::unblockUser(QString userId, std::function<void()> onSuccess, | |||
void TwitchAccount::unblockUser(QString userId, const QObject *caller, | |||
std::function<void()> onSuccess, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: the parameter 'onSuccess' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param]
std::function<void()> onSuccess, | |
const std::function<void()>& onSuccess, |
src/providers/twitch/TwitchAccount.hpp:78:
- std::function<void()> onSuccess,
+ const std::function<void()>& onSuccess,
Description
-DUSE_ALTERNATE_LINKER
cmake option