summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qaction.cpp9
-rw-r--r--src/widgets/kernel/qwidget.cpp4
2 files changed, 3 insertions, 10 deletions
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index 22162895f7..15954abf8c 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -1185,22 +1185,19 @@ void QAction::activate(ActionEvent event)
{
Q_D(QAction);
if(event == Trigger) {
- QObject *guard = this;
- QMetaObject::addGuard(&guard);
+ QWeakPointer<QObject> guard = this;
if(d->checkable) {
// the checked action of an exclusive group cannot be unchecked
if (d->checked && (d->group && d->group->isExclusive()
&& d->group->checkedAction() == this)) {
- if (guard)
+ if (!guard.isNull())
emit triggered(true);
- QMetaObject::removeGuard(&guard);
return;
}
setChecked(!d->checked);
}
- if (guard)
+ if (!guard.isNull())
emit triggered(d->checked);
- QMetaObject::removeGuard(&guard);
} else if(event == Hover) {
emit hovered();
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 7ec37bb929..d20e979cfb 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1469,10 +1469,6 @@ QWidget::~QWidget()
delete d->needsFlush;
d->needsFlush = 0;
- // set all QPointers for this object to zero
- if (d->hasGuards)
- QObjectPrivate::clearGuards(this);
-
if (d->declarativeData) {
QAbstractDeclarativeData::destroyed(d->declarativeData, this);
d->declarativeData = 0; // don't activate again in ~QObject