diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h index d0edef33a2..b87babc07a 100644 --- a/src/corelib/kernel/qcore_mac_p.h +++ b/src/corelib/kernel/qcore_mac_p.h @@ -111,7 +111,8 @@ public: template X as() const { return reinterpret_cast(type); } static QCFType constructFromGet(const T &t) { - CFRetain(t); + if (t) + CFRetain(t); return QCFType(t); } protected: