On September 10, 2009, David Faure wrote: > I finally took the time to investigate the plasma crash that was happening > so often to me.
can you try the attached patch? thanks. -- Aaron J. Seigo humru othro a kohnu se GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA EE75 D6B7 2EB1 A7F1 DB43 KDE core developer sponsored by Qt Development Frameworks
Index: taskgroupitem.cpp
===================================================================
--- taskgroupitem.cpp (revision 1019907)
+++ taskgroupitem.cpp (working copy)
@@ -105,7 +105,8 @@
if (!m_childSplitGroup) {
return;
}
- m_childSplitGroup->deleteLater();
+
+ m_childSplitGroup->destroy();
m_childSplitGroup = 0;
m_splitPosition = 0;
reload();
@@ -535,7 +536,7 @@
}
item->close();
- item->deleteLater();
+ item->destroy();
}
bool TaskGroupItem::isWindowItem() const
@@ -978,7 +979,6 @@
}
AbstractTaskItem *taskItem = abstractTaskItem(item);
-
m_tasksLayout->removeTaskItem(taskItem);
if (m_group) {
Index: abstracttaskitem.cpp
===================================================================
--- abstracttaskitem.cpp (revision 1019907)
+++ abstracttaskitem.cpp (working copy)
@@ -76,7 +76,8 @@
m_hoverEffectTimerId(0),
m_attentionTimerId(0),
m_attentionTicks(0),
- m_fadeIn(true)
+ m_fadeIn(true),
+ m_destroyed(false)
{
setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding));
setAcceptsHoverEvents(true);
@@ -92,6 +93,15 @@
connect(applet, SIGNAL(settingsChanged()), this, SLOT(checkSettings()));
}
+AbstractTaskItem::~AbstractTaskItem()
+{
+ if (m_animId) {
+ Plasma::Animator::self()->stopCustomAnimation(m_animId);
+ }
+
+ Plasma::ToolTipManager::self()->unregisterWidget(this);
+}
+
QSize AbstractTaskItem::basicPreferredSize() const
{
QFontMetrics fm(KGlobalSettings::taskbarFont());
@@ -140,13 +150,15 @@
setPreferredSize(basicPreferredSize());
}
-AbstractTaskItem::~AbstractTaskItem()
+void AbstractTaskItem::destroy()
{
- if (m_animId) {
- Plasma::Animator::self()->stopCustomAnimation(m_animId);
- }
+ m_destroyed = true;
+ QObject::deleteLater();
+}
- Plasma::ToolTipManager::self()->unregisterWidget(this);
+bool AbstractTaskItem::isDestroyed() const
+{
+ return m_destroyed;
}
void AbstractTaskItem::checkSettings()
Index: abstracttaskitem.h
===================================================================
--- abstracttaskitem.h (revision 1019907)
+++ abstracttaskitem.h (working copy)
@@ -129,6 +129,9 @@
void setPreferredOffscreenSize();
void setPreferredOnscreenSize();
+ void destroy();
+ bool isDestroyed() const;
+
Q_SIGNALS:
void activated(AbstractTaskItem *);
@@ -232,11 +235,15 @@
int m_attentionTicks;
bool m_fadeIn : 1;
+ bool m_destroyed : 1;
// distance (in pixels) between a task's icon and its text
static const int IconTextSpacing = 4;
static const int TaskItemHorizontalMargin = 4;
static const int TaskItemVerticalMargin = 4;
+
+private:
+ void deleteLater();
};
#endif
Index: taskitemlayout.cpp
===================================================================
--- taskitemlayout.cpp (revision 1019907)
+++ taskitemlayout.cpp (working copy)
@@ -106,7 +106,7 @@
bool TaskItemLayout::insert(int index, AbstractTaskItem* item)
{
//kDebug() << item->text() << index;
- if (!item ) {
+ if (!item || item->isDestroyed()) {
kDebug() << "error";
return false;
}
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Plasma-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/plasma-devel
