From 233be5ec13657519132d6deb22ae0504dc87c6a9 Mon Sep 17 00:00:00 2001
From: John Preston <johnprestonmail@gmail.com>
Date: Wed, 6 Jun 2018 12:32:38 +0300
Subject: [PATCH] Fix crash in web request destructors.

---
 Telegram/SourceFiles/mtproto/special_config_request.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Telegram/SourceFiles/mtproto/special_config_request.cpp b/Telegram/SourceFiles/mtproto/special_config_request.cpp
index d60d9b72c..81735e9fa 100644
--- a/Telegram/SourceFiles/mtproto/special_config_request.cpp
+++ b/Telegram/SourceFiles/mtproto/special_config_request.cpp
@@ -147,8 +147,13 @@ ServiceWebRequest &ServiceWebRequest::operator=(ServiceWebRequest &&other) {
 
 void ServiceWebRequest::destroy() {
 	if (const auto value = base::take(reply)) {
-		value->deleteLater();
+		value->disconnect(
+			value,
+			&QNetworkReply::finished,
+			nullptr,
+			nullptr);
 		value->abort();
+		value->deleteLater();
 	}
 }