mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-01-29 19:03:03 +00:00
Fix crash in forwarding box.
This commit is contained in:
parent
776dd8b928
commit
03b0c0cff4
@ -910,7 +910,12 @@ void ChooseRecipientBoxController::prepareViewHook() {
|
||||
}
|
||||
|
||||
void ChooseRecipientBoxController::rowClicked(not_null<PeerListRow*> row) {
|
||||
_callback(row->peer());
|
||||
auto weak = base::make_weak(this);
|
||||
auto callback = std::move(_callback);
|
||||
callback(row->peer());
|
||||
if (weak) {
|
||||
_callback = std::move(callback);
|
||||
}
|
||||
}
|
||||
|
||||
auto ChooseRecipientBoxController::createRow(
|
||||
|
@ -198,7 +198,9 @@ private:
|
||||
|
||||
};
|
||||
|
||||
class AddBotToGroupBoxController : public ChatsListBoxController, public base::has_weak_ptr {
|
||||
class AddBotToGroupBoxController
|
||||
: public ChatsListBoxController
|
||||
, public base::has_weak_ptr {
|
||||
public:
|
||||
static void Start(not_null<UserData*> bot);
|
||||
|
||||
@ -227,7 +229,9 @@ private:
|
||||
|
||||
};
|
||||
|
||||
class ChooseRecipientBoxController : public ChatsListBoxController {
|
||||
class ChooseRecipientBoxController
|
||||
: public ChatsListBoxController
|
||||
, public base::has_weak_ptr {
|
||||
public:
|
||||
ChooseRecipientBoxController(
|
||||
FnMut<void(not_null<PeerData*>)> callback);
|
||||
|
Loading…
Reference in New Issue
Block a user