aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-01-06 09:52:33 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-01-06 09:28:45 +0000
commitbac8e84ee732c73481c562378341d795b8dc41ce (patch)
tree1bc2e842f7d5766ae0b7b064d625417ebe2587e4
parent4f7ec6143afce84804a230306008caefaa86a05b (diff)
QQuickXxxPrivate::deleteDelegate(): don't store null pointers
Avoid unnecessarily allocating extra data and/or pendingDeletions. Change-Id: I41d68af513c078a48bbe4f026bfe25e9c45ba3a8 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/quicktemplates2/qquickcontrol.cpp2
-rw-r--r--src/quicktemplates2/qquicklabel.cpp2
-rw-r--r--src/quicktemplates2/qquicktextarea.cpp2
-rw-r--r--src/quicktemplates2/qquicktextfield.cpp2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index d8088f24..9aa310ff 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -850,7 +850,7 @@ void QQuickControlPrivate::deleteDelegate(QObject *delegate)
{
if (componentComplete)
delete delegate;
- else
+ else if (delegate)
extra.value().pendingDeletions.append(delegate);
}
diff --git a/src/quicktemplates2/qquicklabel.cpp b/src/quicktemplates2/qquicklabel.cpp
index ebd1755a..37a0842f 100644
--- a/src/quicktemplates2/qquicklabel.cpp
+++ b/src/quicktemplates2/qquicklabel.cpp
@@ -175,7 +175,7 @@ void QQuickLabelPrivate::deleteDelegate(QObject *delegate)
{
if (componentComplete)
delete delegate;
- else
+ else if (delegate)
pendingDeletions.append(delegate);
}
diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp
index 56a538ee..4a0c4a72 100644
--- a/src/quicktemplates2/qquicktextarea.cpp
+++ b/src/quicktemplates2/qquicktextarea.cpp
@@ -410,7 +410,7 @@ void QQuickTextAreaPrivate::deleteDelegate(QObject *delegate)
{
if (componentComplete)
delete delegate;
- else
+ else if (delegate)
pendingDeletions.append(delegate);
}
diff --git a/src/quicktemplates2/qquicktextfield.cpp b/src/quicktemplates2/qquicktextfield.cpp
index 2bb902a1..a4f14d48 100644
--- a/src/quicktemplates2/qquicktextfield.cpp
+++ b/src/quicktemplates2/qquicktextfield.cpp
@@ -289,7 +289,7 @@ void QQuickTextFieldPrivate::deleteDelegate(QObject *delegate)
{
if (componentComplete)
delete delegate;
- else
+ else if (delegate)
pendingDeletions.append(delegate);
}