Fix GCC 13 warning about freeing the global static

I believe the problem is that QGlobalStatic::operator Type *() may
return a null pointer, in which case the compiler is right that we could
attempt to free the shared_null. Instead use QGlobalStatic::operator*,
which doesn't ever return nullptr.

Change-Id: I9201d9ecf52f4146bb04fffd17644782bf0eb9d1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Thiago Macieira 2023-05-31 09:31:24 -07:00
parent 211b54ea47
commit 766deb0e43

View File

@ -21,7 +21,7 @@ class QPrinterInfoPrivateDeleter
public:
static inline void cleanup(QPrinterInfoPrivate *d)
{
if (d != shared_null)
if (d != &*shared_null)
delete d;
}
};