mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-22 03:08:48 +00:00
fixed crash in mtpFileLoader delayed destroy, finishing breakpad at the very end, 0.9.29 dev
This commit is contained in:
parent
ebfeeb6872
commit
cde264e5a1
@ -344,23 +344,6 @@ void Application::closeApplication() {
|
||||
if (_updateThread) _updateThread->quit();
|
||||
_updateThread = 0;
|
||||
#endif
|
||||
|
||||
DEBUG_LOG(("Telegram finished, result: %1").arg("unknown"));
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
if (cRestartingUpdate()) {
|
||||
DEBUG_LOG(("Application Info: executing updater to install update.."));
|
||||
psExecUpdater();
|
||||
} else
|
||||
#endif
|
||||
if (cRestarting()) {
|
||||
DEBUG_LOG(("Application Info: executing Telegram, because of restart.."));
|
||||
psExecTelegram();
|
||||
}
|
||||
|
||||
SignalHandlers::finish();
|
||||
PlatformSpecific::finish();
|
||||
Logs::finish();
|
||||
}
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
@ -1067,7 +1050,7 @@ AppClass::~AppClass() {
|
||||
App::deinitMedia();
|
||||
deinitImageLinkManager();
|
||||
|
||||
MTP::stop();
|
||||
MTP::finish();
|
||||
|
||||
AppObject = 0;
|
||||
deleteAndMark(_uploader);
|
||||
|
@ -43,6 +43,26 @@ int main(int argc, char *argv[]) {
|
||||
//int a_argc = a_cnt + 1;
|
||||
//char *a_argv[a_cnt + 1] = { argv[0], args[0].data() };
|
||||
|
||||
Application app(argc, argv);
|
||||
return app.exec();
|
||||
int result = 0;
|
||||
{
|
||||
Application app(argc, argv);
|
||||
result = app.exec();
|
||||
}
|
||||
|
||||
DEBUG_LOG(("Telegram finished, result: %1").arg(result));
|
||||
|
||||
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
||||
if (cRestartingUpdate()) {
|
||||
DEBUG_LOG(("Application Info: executing updater to install update.."));
|
||||
psExecUpdater();
|
||||
} else
|
||||
#endif
|
||||
if (cRestarting()) {
|
||||
DEBUG_LOG(("Application Info: executing Telegram, because of restart.."));
|
||||
psExecTelegram();
|
||||
}
|
||||
|
||||
SignalHandlers::finish();
|
||||
PlatformSpecific::finish();
|
||||
Logs::finish();
|
||||
}
|
||||
|
@ -758,6 +758,8 @@ namespace MTP {
|
||||
}
|
||||
|
||||
void cancel(mtpRequestId requestId) {
|
||||
if (!_started) return;
|
||||
|
||||
mtpMsgId msgId = 0;
|
||||
requestsDelays.remove(requestId);
|
||||
{
|
||||
@ -831,7 +833,7 @@ namespace MTP {
|
||||
return MTP::RequestConnecting;
|
||||
}
|
||||
|
||||
void stop() {
|
||||
void finish() {
|
||||
for (Sessions::iterator i = sessions.begin(), e = sessions.end(); i != e; ++i) {
|
||||
i.value()->kill();
|
||||
delete i.value();
|
||||
|
@ -132,9 +132,7 @@ namespace MTP {
|
||||
};
|
||||
int32 state(mtpRequestId req); // < 0 means waiting for such count of ms
|
||||
|
||||
void defOnError(const RPCError &err);
|
||||
|
||||
void stop();
|
||||
void finish();
|
||||
|
||||
void authed(int32 uid);
|
||||
int32 authedId();
|
||||
|
@ -527,7 +527,7 @@ void mtpFileLoader::cancelRequests() {
|
||||
_queue->queries -= _requests.size();
|
||||
_requests.clear();
|
||||
|
||||
if (!_queue->queries) {
|
||||
if (!_queue->queries && App::app()) {
|
||||
App::app()->killDownloadSessionsStart(_dc);
|
||||
}
|
||||
}
|
||||
|
@ -1393,6 +1393,12 @@ void DocumentData::recountIsImage() {
|
||||
|
||||
DocumentData::~DocumentData() {
|
||||
delete _additional;
|
||||
|
||||
if (loading()) {
|
||||
_loader->deleteLater();
|
||||
_loader->stop();
|
||||
_loader = 0;
|
||||
}
|
||||
}
|
||||
|
||||
WebPageData::WebPageData(const WebPageId &id, WebPageType type, const QString &url, const QString &displayUrl, const QString &siteName, const QString &title, const QString &description, PhotoData *photo, DocumentData *doc, int32 duration, const QString &author, int32 pendingTill) : id(id)
|
||||
|
Loading…
Reference in New Issue
Block a user