fixed double fclose of crash dump file, removed block user context menu item for App::self()
This commit is contained in:
		
							parent
							
								
									f775d27371
								
							
						
					
					
						commit
						17aaa5ceab
					
				
					 2 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
					@ -619,7 +619,7 @@ void DialogsInner::contextMenuEvent(QContextMenuEvent *e) {
 | 
				
			||||||
	if (_menuPeer->isUser()) {
 | 
						if (_menuPeer->isUser()) {
 | 
				
			||||||
		_menu->addAction(lang(lng_profile_clear_history), this, SLOT(onContextClearHistory()))->setEnabled(true);
 | 
							_menu->addAction(lang(lng_profile_clear_history), this, SLOT(onContextClearHistory()))->setEnabled(true);
 | 
				
			||||||
		_menu->addAction(lang(lng_profile_delete_conversation), this, SLOT(onContextDeleteAndLeave()))->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);
 | 
								_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*)));
 | 
								connect(App::main(), SIGNAL(peerUpdated(PeerData*)), this, SLOT(peerUpdated(PeerData*)));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -607,7 +607,7 @@ void _moveOldDataFiles(const QString &wasDir) {
 | 
				
			||||||
namespace SignalHandlers {
 | 
					namespace SignalHandlers {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QString CrashDumpPath;
 | 
						QString CrashDumpPath;
 | 
				
			||||||
	FILE *CrashDumpFile = 0;
 | 
						FILE *CrashDumpFile = nullptr;
 | 
				
			||||||
	int CrashDumpFileNo = 0;
 | 
						int CrashDumpFileNo = 0;
 | 
				
			||||||
	char LaunchedDateTimeStr[32] = { 0 };
 | 
						char LaunchedDateTimeStr[32] = { 0 };
 | 
				
			||||||
	char LaunchedBinaryName[256] = { 0 };
 | 
						char LaunchedBinaryName[256] = { 0 };
 | 
				
			||||||
| 
						 | 
					@ -999,6 +999,8 @@ namespace SignalHandlers {
 | 
				
			||||||
		FinishBreakpad();
 | 
							FinishBreakpad();
 | 
				
			||||||
		if (CrashDumpFile) {
 | 
							if (CrashDumpFile) {
 | 
				
			||||||
			fclose(CrashDumpFile);
 | 
								fclose(CrashDumpFile);
 | 
				
			||||||
 | 
								CrashDumpFile = nullptr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#ifdef Q_OS_WIN
 | 
					#ifdef Q_OS_WIN
 | 
				
			||||||
			_wunlink(CrashDumpPath.toStdWString().c_str());
 | 
								_wunlink(CrashDumpPath.toStdWString().c_str());
 | 
				
			||||||
#else
 | 
					#else
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue