Fix couple of possible crashes.

Fixes #24613.
This commit is contained in:
John Preston
2022-06-20 20:27:00 +04:00
parent 66e9c5ef16
commit 3c1663adeb
3 changed files with 5 additions and 2 deletions
@@ -3482,6 +3482,7 @@ void GroupCall::destroyController() {
DEBUG_LOG(("Call Info: Destroying call controller.."));
invalidate_weak_ptrs(&_instanceGuard);
_instance->stop();
crl::async([
instance = base::take(_instance),
done = _delegate->groupCallAddAsyncWaiter()
@@ -3497,6 +3498,8 @@ void GroupCall::destroyScreencast() {
if (_screenInstance) {
DEBUG_LOG(("Call Info: Destroying call screen controller.."));
invalidate_weak_ptrs(&_screenInstanceGuard);
_screenInstance->stop();
crl::async([
instance = base::take(_screenInstance),
done = _delegate->groupCallAddAsyncWaiter()