From 3904a9f9a0908ff96a37fcffb15260a7c351e815 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 11 Dec 2018 17:12:35 +0400 Subject: [PATCH] Add guard in layers destruction. --- Telegram/SourceFiles/window/layer_widget.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/window/layer_widget.cpp b/Telegram/SourceFiles/window/layer_widget.cpp index 73e9fa726..7d918fe62 100644 --- a/Telegram/SourceFiles/window/layer_widget.cpp +++ b/Telegram/SourceFiles/window/layer_widget.cpp @@ -559,9 +559,12 @@ void LayerStackWidget::startAnimation( } else { setupNewWidgets(); setCacheImages(); + const auto weak = make_weak(this); clearOldWidgets(); - prepareForAnimation(); - _background->startAnimation(action); + if (weak) { + prepareForAnimation(); + _background->startAnimation(action); + } } }