-
-
Notifications
You must be signed in to change notification settings - Fork 455
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -121,11 +121,12 @@ void TwitchAccount::loadBlocks() | |||||
}); | ||||||
} | ||||||
|
||||||
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 commentThe 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]
Suggested change
src/providers/twitch/TwitchAccount.hpp:75: - std::function<void()> onSuccess,
+ const std::function<void()>& onSuccess, |
||||||
std::function<void()> onFailure) | ||||||
{ | ||||||
getHelix()->blockUser( | ||||||
userId, | ||||||
userId, caller, | ||||||
[this, userId, onSuccess] { | ||||||
TwitchUser blockedUser; | ||||||
blockedUser.id = userId; | ||||||
|
@@ -141,11 +142,12 @@ void TwitchAccount::blockUser(QString userId, std::function<void()> onSuccess, | |||||
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 commentThe 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]
Suggested change
src/providers/twitch/TwitchAccount.hpp:77: - void unblockUser(QString userId, const QObject *caller,
+ void unblockUser(const QString& userId, const QObject *caller, |
||||||
std::function<void()> onSuccess, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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]
Suggested change
src/providers/twitch/TwitchAccount.hpp:78: - std::function<void()> onSuccess,
+ const std::function<void()>& onSuccess, |
||||||
std::function<void()> onFailure) | ||||||
{ | ||||||
getHelix()->unblockUser( | ||||||
userId, | ||||||
userId, caller, | ||||||
[this, userId, onSuccess] { | ||||||
TwitchUser ignoredUser; | ||||||
ignoredUser.id = userId; | ||||||
|
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]
src/providers/twitch/TwitchAccount.hpp:74: