From 766deb0e43a1d1772054b45ba55466da3d7ff344 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 31 May 2023 09:31:24 -0700 Subject: [PATCH] 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 --- src/printsupport/kernel/qprinterinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/printsupport/kernel/qprinterinfo.cpp b/src/printsupport/kernel/qprinterinfo.cpp index 654c3b079b..59078b4df4 100644 --- a/src/printsupport/kernel/qprinterinfo.cpp +++ b/src/printsupport/kernel/qprinterinfo.cpp @@ -21,7 +21,7 @@ class QPrinterInfoPrivateDeleter public: static inline void cleanup(QPrinterInfoPrivate *d) { - if (d != shared_null) + if (d != &*shared_null) delete d; } };