2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Removed some old styles. Divided basic_types module to several.

This commit is contained in:
John Preston
2016-09-29 14:37:16 +03:00
parent 73a8d27bfd
commit f1f7333c7a
48 changed files with 1567 additions and 1574 deletions

View File

@@ -19,10 +19,11 @@ Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#include "stdafx.h"
#include "logs.h"
#include <signal.h>
#include <new>
#include "pspecific.h"
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
@@ -736,6 +737,22 @@ namespace internal {
namespace internal {
struct SomeAllocatedMemoryChunk {
char data[1024 * 1024];
};
std_::unique_ptr<SomeAllocatedMemoryChunk> SomeAllocatedMemory;
void OperatorNewHandler() {
std::set_new_handler(nullptr);
SomeAllocatedMemory.reset();
t_assert(!"Could not allocate!");
}
void InstallOperatorNewHandler() {
SomeAllocatedMemory = std_::make_unique<SomeAllocatedMemoryChunk>();
std::set_new_handler(OperatorNewHandler);
}
Qt::HANDLE ReportingThreadId = nullptr;
bool ReportingHeaderWritten = false;
QMutex ReportingMutex;
@@ -1078,6 +1095,9 @@ namespace internal {
signal(SIGFPE, SignalHandlers::internal::Handler);
#endif // else for !Q_OS_WIN
}
SignalHandlers::internal::InstallOperatorNewHandler();
return Started;
}