[Kst] [Bug 142701] Cross power spectrum causes continuous asserts in KstRWLock
Adam Treat
treat at kde.org
Tue Apr 3 20:19:19 CEST 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=142701
treat kde org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From treat kde org 2007-04-03 20:19 -------
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();
More information about the Kst
mailing list