try to avoid managing eventfilter on delete objects

svn path=/trunk/KDE/kdelibs/; revision=1127690
This commit is contained in:
Marco Martin 2010-05-17 10:44:34 +00:00
parent f61acfa498
commit bf5beef483

View File

@ -66,6 +66,7 @@ FocusIndicator::FocusIndicator(QGraphicsWidget *parent, QString widget)
FocusIndicator::~FocusIndicator() FocusIndicator::~FocusIndicator()
{ {
m_parent->removeEventFilter(this);
delete m_fade; delete m_fade;
} }
@ -82,7 +83,7 @@ void FocusIndicator::setCustomPrefix(const QString &prefix)
bool FocusIndicator::eventFilter(QObject *watched, QEvent *event) bool FocusIndicator::eventFilter(QObject *watched, QEvent *event)
{ {
if (static_cast<QGraphicsWidget *>(watched) != m_parent) { if (static_cast<QGraphicsWidget *>(watched) != m_parent || !m_parent) {
return false; return false;
} }