[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Tue Apr 5 21:15:21 CEST 2005
CVS commit by staikos:
put a lock on the update. not sure if it will deadlock, but it will block so
it's bad nonetheless. also use constiterator
M +4 -2 ksteventmonitorentry.cpp 1.38
--- kdeextragear-2/kst/kst/ksteventmonitorentry.cpp #1.37:1.38
@@ -87,5 +87,5 @@ EventMonitorEntry::EventMonitorEntry(con
// wait for the initial update, as we don't want to trigger elog entries
// until we are sure the document is open...
- QTimer::singleShot( 500, this, SLOT(slotUpdate())); // FIXME: timer event could appear in the wrong thread.
+ QTimer::singleShot( 500, this, SLOT(slotUpdate()));
}
@@ -137,4 +137,6 @@ EventMonitorEntry::~EventMonitorEntry()
void EventMonitorEntry::slotUpdate() {
+ // possible deadlock? bad idea. updates should only happen in update thread
+ KstWriteLocker wl(this);
update();
}
@@ -178,5 +180,5 @@ KstObject::UpdateType EventMonitorEntry:
if (_vectorsUsed.count() > 0) {
- for (KstVectorMap::Iterator i = _vectorsUsed.begin(); i != _vectorsUsed.end(); ++i) {
+ for (KstVectorMap::ConstIterator i = _vectorsUsed.begin(); i != _vectorsUsed.end(); ++i) {
if (i.data()->length() > ns) {
ns = i.data()->length();
More information about the Kst
mailing list