From 3aa2e592e01a1bc4ea8884a3ca16efcdd681a4ee Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 28 Dec 2015 01:49:08 +0300 Subject: [PATCH] fixed 9015003 build for os x --- Telegram/SourceFiles/application.cpp | 4 +++- Telegram/SourceFiles/gui/animation.cpp | 2 ++ Telegram/SourceFiles/gui/animation.h | 2 +- Telegram/SourceFiles/logs.h | 3 ++- Telegram/SourceFiles/types.h | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 70708b29e2..06e0f1cfdd 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -897,7 +897,9 @@ Application::~Application() { updateThread = 0; #endif - delete window; + Window *w = window; + window = 0; + delete w; delete cChatBackground(); cSetChatBackground(0); diff --git a/Telegram/SourceFiles/gui/animation.cpp b/Telegram/SourceFiles/gui/animation.cpp index 59830a2af6..46bc430d00 100644 --- a/Telegram/SourceFiles/gui/animation.cpp +++ b/Telegram/SourceFiles/gui/animation.cpp @@ -300,6 +300,8 @@ QPixmap ClipReader::current(int32 framew, int32 frameh, int32 outerw, int32 oute _request.outerh = outerh * factor; QImage current(_currentOriginal); + current.setDevicePixelRatio(cRetinaFactor()); + result = _current = QPixmap(); result = _current = _prepareFrame(_request, current, _cacheForResize, true); diff --git a/Telegram/SourceFiles/gui/animation.h b/Telegram/SourceFiles/gui/animation.h index 487389845c..60c4a1cfc5 100644 --- a/Telegram/SourceFiles/gui/animation.h +++ b/Telegram/SourceFiles/gui/animation.h @@ -366,7 +366,7 @@ public: } typename AnimType::Type current() { - return _data ? _data->a.current() : AnimType::Type(); + return _data ? _data->a.current() : typename AnimType::Type(); } typename AnimType::Type current(uint64 ms, const typename AnimType::Type &def) { diff --git a/Telegram/SourceFiles/logs.h b/Telegram/SourceFiles/logs.h index d3c530375c..d1bd7199e3 100644 --- a/Telegram/SourceFiles/logs.h +++ b/Telegram/SourceFiles/logs.h @@ -82,10 +82,11 @@ void logWrite(const QString &v); #define LOG(msg) (logWrite(QString msg)) //usage LOG(("log: %1 %2").arg(1).arg(2)) +static volatile int *t_assert_nullptr = 0; inline void t_noop() {} inline void t_assert_fail(const char *condition, const char *file, int32 line) { LOG(("Assertion Failed! \"%1\" %2:%3").arg(condition).arg(file).arg(line)); - *(int*)0 = 0; + *t_assert_nullptr = 0; } #define t_assert(cond) ((!(cond)) ? t_assert_fail(#cond, __FILE__, __LINE__) : t_noop()) diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index 53579ab768..ab3b721170 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -502,7 +502,7 @@ private: }; template -Function *func(Object *obj, typename ReturnType (Object::*method)()) { +Function *func(Object *obj, ReturnType (Object::*method)()) { return new ObjectFunction(obj, method); }