From e616f8decb998f68753300c8282b48d05bd6fd01 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 28 Nov 2023 09:24:10 +0100 Subject: [PATCH] Add missing detach when clearing font features Same as when setting the features, we need to detach (but keep the engine data) when clearing them. Change-Id: I3adcadfb24c4abfff9c9e1c4f42ed4af919c71f0 Reviewed-by: Konstantin Ritt --- src/gui/text/qfont.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index f8872393fb..875ae519e6 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -2481,6 +2481,10 @@ bool QFont::isFeatureSet(Tag tag) const */ void QFont::clearFeatures() { + if (d->features.isEmpty()) + return; + + d->detachButKeepEngineData(this); d->features.clear(); }