From 17aaa5ceab91e076e4394635be33df90e425b719 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 11 Mar 2016 23:07:13 +0300 Subject: [PATCH] fixed double fclose of crash dump file, removed block user context menu item for App::self() --- Telegram/SourceFiles/dialogswidget.cpp | 2 +- Telegram/SourceFiles/logs.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index c2b685e27..620e3b9dd 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -619,7 +619,7 @@ void DialogsInner::contextMenuEvent(QContextMenuEvent *e) { if (_menuPeer->isUser()) { _menu->addAction(lang(lng_profile_clear_history), this, SLOT(onContextClearHistory()))->setEnabled(true); _menu->addAction(lang(lng_profile_delete_conversation), this, SLOT(onContextDeleteAndLeave()))->setEnabled(true); - if (_menuPeer->asUser()->access != UserNoAccess) { + if (_menuPeer->asUser()->access != UserNoAccess && _menuPeer != App::self()) { _menu->addAction(lang((_menuPeer->asUser()->blocked == UserIsBlocked) ? (_menuPeer->asUser()->botInfo ? lng_profile_unblock_bot : lng_profile_unblock_user) : (_menuPeer->asUser()->botInfo ? lng_profile_block_bot : lng_profile_block_user)), this, SLOT(onContextToggleBlock()))->setEnabled(true); connect(App::main(), SIGNAL(peerUpdated(PeerData*)), this, SLOT(peerUpdated(PeerData*))); } diff --git a/Telegram/SourceFiles/logs.cpp b/Telegram/SourceFiles/logs.cpp index a70476054..84bd34538 100644 --- a/Telegram/SourceFiles/logs.cpp +++ b/Telegram/SourceFiles/logs.cpp @@ -607,7 +607,7 @@ void _moveOldDataFiles(const QString &wasDir) { namespace SignalHandlers { QString CrashDumpPath; - FILE *CrashDumpFile = 0; + FILE *CrashDumpFile = nullptr; int CrashDumpFileNo = 0; char LaunchedDateTimeStr[32] = { 0 }; char LaunchedBinaryName[256] = { 0 }; @@ -999,6 +999,8 @@ namespace SignalHandlers { FinishBreakpad(); if (CrashDumpFile) { fclose(CrashDumpFile); + CrashDumpFile = nullptr; + #ifdef Q_OS_WIN _wunlink(CrashDumpPath.toStdWString().c_str()); #else