From 8c1e546123cf2982cfd1fed83378be39918de14e Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 29 Oct 2018 17:49:01 +0400 Subject: [PATCH] Fix crash in DocumentData destructor. ~DocumentData sometimes calls ~Image that calls RemoteSource::unload. It tries to schedule delayed loaded deletion and accesses Auth(). But ~DocumentData is called from ~Session, so Auth() is unaccessible. --- Telegram/SourceFiles/ui/image/image_source.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/ui/image/image_source.cpp b/Telegram/SourceFiles/ui/image/image_source.cpp index f52d4e206..88e7f4d79 100644 --- a/Telegram/SourceFiles/ui/image/image_source.cpp +++ b/Telegram/SourceFiles/ui/image/image_source.cpp @@ -402,7 +402,7 @@ void RemoteSource::cancel() { void RemoteSource::unload() { if (loaderValid()) { - destroyLoaderDelayed(); + delete base::take(_loader); } }