mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-31 15:59:54 +00:00
crash fixed in Title::updateCounter, assertion message added to crash report
This commit is contained in:
parent
f13c61fbaf
commit
9e1a6d3d3d
@ -1021,4 +1021,8 @@ namespace SignalHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
void setAssertionInfo(const QString &info) {
|
||||
ProcessAnnotations["Assertion"] = info.toUtf8().constData();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -108,5 +108,6 @@ namespace SignalHandlers {
|
||||
void finish();
|
||||
|
||||
void setSelfUsername(const QString &username);
|
||||
void setAssertionInfo(const QString &info);
|
||||
|
||||
}
|
||||
|
@ -851,8 +851,10 @@ namespace {
|
||||
} else {
|
||||
_psShadowWindows.setColor(_shInactive);
|
||||
}
|
||||
QTimer::singleShot(0, App::wnd(), SLOT(updateCounter()));
|
||||
App::wnd()->update();
|
||||
if (Global::started()) {
|
||||
QMetaObject::invokeMethod(App::wnd(), "updateCounter", Qt::QueuedConnection);
|
||||
App::wnd()->update();
|
||||
}
|
||||
} return false;
|
||||
|
||||
case WM_NCPAINT: if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS8) return false; *result = 0; return true;
|
||||
|
@ -68,6 +68,9 @@ public:
|
||||
|
||||
};
|
||||
|
||||
#define qsl(s) QStringLiteral(s)
|
||||
#define qstr(s) QLatin1String(s, sizeof(s) - 1)
|
||||
|
||||
//typedef unsigned char uchar; // Qt has uchar
|
||||
typedef qint16 int16;
|
||||
typedef quint16 uint16;
|
||||
@ -109,7 +112,9 @@ using std::swap;
|
||||
static volatile int *t_assert_nullptr = 0;
|
||||
inline void t_noop() {}
|
||||
inline void t_assert_fail(const char *message, const char *file, int32 line) {
|
||||
LOG(("Assertion Failed! %1 %2:%3").arg(message).arg(file).arg(line));
|
||||
QString info(qsl("%1 %2:%3").arg(message).arg(file).arg(line));
|
||||
LOG(("Assertion Failed! %1 %2:%3").arg(info));
|
||||
SignalHandlers::setAssertionInfo(info);
|
||||
*t_assert_nullptr = 0;
|
||||
}
|
||||
#define t_assert_full(condition, message, file, line) ((!(condition)) ? t_assert_fail(message, file, line) : t_noop())
|
||||
@ -277,9 +282,6 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#define qsl(s) QStringLiteral(s)
|
||||
#define qstr(s) QLatin1String(s, sizeof(s) - 1)
|
||||
|
||||
inline QString fromUtf8Safe(const char *str, int32 size = -1) {
|
||||
if (!str || !size) return QString();
|
||||
if (size < 0) size = int32(strlen(str));
|
||||
|
@ -697,6 +697,8 @@ void Window::setupMain(bool anim, const MTPUser *self) {
|
||||
}
|
||||
|
||||
void Window::updateCounter() {
|
||||
if (App::quitting()) return;
|
||||
|
||||
psUpdateCounter();
|
||||
title->updateCounter();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user