Summary: | Cross power spectrum causes continuous asserts in KstRWLock | ||
---|---|---|---|
Product: | [Applications] kst | Reporter: | Andrew Walker <arwalker> |
Component: | general | Assignee: | kst |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 1.x | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | Fixes asserts in plugin |
Description
Andrew Walker
2007-03-08 20:54:22 UTC
This may also be an issue with other plugins. It is possible the deadlock is related to the time spent processing the plugin. Created attachment 20163 [details]
Fixes asserts in plugin
Looks good. -- George Staikos KDE Developer http://www.kde.org/ Staikos Computing Services Inc. http://www.staikos.net/ SVN commit 650060 by treat: * No more asserts BUG:142701* No more asserts BUG:142701* No more asserts BUG:142701* No more asserts BUG:142701* No more asserts BUG:142701* No more asserts BUG:142701* No more asserts BUG:142701* No more asserts BUG:142701 M +6 -0 crosspowerspectrum.cpp M +1 -16 crossspectrumdialog_i.cpp --- trunk/extragear/graphics/kst/src/plugins/crossspectrum/crosspowerspectrum.cpp #650059:650060 @@ -235,6 +235,8 @@ KstObject::UpdateType CrossPowerSpectrum::update(int updateCounter) { + Q_ASSERT(myLockStatus() == KstRWLock::WRITELOCKED); + bool force = dirty(); setDirty(false); @@ -248,6 +250,8 @@ bool depUpdated = force; + writeLockInputsAndOutputs(); + depUpdated = UPDATE == v1()->update(updateCounter) || depUpdated; depUpdated = UPDATE == v2()->update(updateCounter) || depUpdated; @@ -271,6 +275,8 @@ frequency()->setNewAndShift(frequency()->length(), frequency()->numShift()); frequency()->update(updateCounter); + unlockInputsAndOutputs(); + return setLastUpdateResult(depUpdated ? UPDATE : NO_CHANGE); } --- trunk/extragear/graphics/kst/src/plugins/crossspectrum/crossspectrumdialog_i.cpp #650059:650060 @@ -91,15 +91,13 @@ CrossPowerSpectrumPtr cps = kst_cast<CrossPowerSpectrum>(KstDataObject::createPlugin("Cross Power Spectrum")); Q_ASSERT(cps); //should never happen... - cps->writeLock(); + KstWriteLocker pl(cps); if (tagName == defaultTag) { tagName = KST::suggestPluginName("crosspowerspectrum"); } cps->setTagName(KstObjectTag::fromString(tagName)); - cps->unlock(); - // Save the vectors and scalars if (!editSingleObject(cps) || !cps->isValid()) { KMessageBox::sorry(this, i18n("There is an error in the values you entered.")); @@ -144,19 +142,6 @@ cps->setTagName(KstObjectTag::fromString(_tagName->text())); -#if 0 - // Must unlock before clear() - for (KstVectorMap::Iterator i = cps->inputVectors().begin(); i != cps->inputVectors().end(); ++i) { - (*i)->unlock(); - } - for (KstScalarMap::Iterator i = cps->inputScalars().begin(); i != cps->inputScalars().end(); ++i) { - (*i)->unlock(); - } - for (KstStringMap::Iterator i = cps->inputStrings().begin(); i != cps->inputStrings().end(); ++i) { - (*i)->unlock(); - } -#endif - cps->inputVectors().clear(); cps->inputScalars().clear(); cps->inputStrings().clear(); |