Fix crash in forwarding box.

This commit is contained in:
John Preston
2018-11-30 09:45:22 +04:00
parent 776dd8b928
commit 03b0c0cff4
2 changed files with 12 additions and 3 deletions

View File

@@ -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(