diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 70708b29e..06e0f1cfd 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 59830a2af..46bc430d0 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 487389845..60c4a1cfc 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 d3c530375..d1bd7199e 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 53579ab76..ab3b72117 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); }