crash fixed in Title::updateCounter, assertion message added to crash report

This commit is contained in:
John Preston 2016-03-15 15:18:12 +03:00
parent f13c61fbaf
commit 9e1a6d3d3d
5 changed files with 17 additions and 6 deletions

View File

@ -1021,4 +1021,8 @@ namespace SignalHandlers {
}
}
void setAssertionInfo(const QString &info) {
ProcessAnnotations["Assertion"] = info.toUtf8().constData();
}
}

View File

@ -108,5 +108,6 @@ namespace SignalHandlers {
void finish();
void setSelfUsername(const QString &username);
void setAssertionInfo(const QString &info);
}

View File

@ -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;

View File

@ -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));

View File

@ -697,6 +697,8 @@ void Window::setupMain(bool anim, const MTPUser *self) {
}
void Window::updateCounter() {
if (App::quitting()) return;
psUpdateCounter();
title->updateCounter();
}