summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2023-05-31 09:31:24 -0700
committerThiago Macieira <thiago.macieira@intel.com>2023-06-06 15:26:04 -0700
commit766deb0e43a1d1772054b45ba55466da3d7ff344 (patch)
tree1a5b17523ccd3bfd84fac9ea259f6d8106005578 /src/printsupport/kernel
parent211b54ea470a0c7f69205f045593aaa4efd01072 (diff)
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>
Diffstat (limited to 'src/printsupport/kernel')
-rw-r--r--src/printsupport/kernel/qprinterinfo.cpp2
1 files changed, 1 insertions, 1 deletions
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;
}
};