| Summary: | Can't delete view objects | ||
|---|---|---|---|
| Product: | [Applications] kst | Reporter: | Netterfield <netterfield> |
| Component: | general | Assignee: | kst |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | VHI | ||
| Version First Reported In: | 1.x | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Netterfield
2006-01-25 00:21:18 UTC
I did get kst to crash while playing around with this. It may or may not be related. SVN commit 502164 by arwalker:
BUG:120751 The line rc == rc && (*i)->removeChild(obj, true) in KstViewObject::removeChild(...) was not having the desired effect as if rc is false the rest of the line is ignored. The solution is to simply reverse the order of the operation.
M +3 -1 kstviewobject.cpp
--- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #502163:502164
@@ -461,13 +461,15 @@
bool KstViewObject::removeChild(KstViewObjectPtr obj, bool recursive) {
bool rc = _children.remove(obj) > 0;
+
if (recursive) {
for (KstViewObjectList::Iterator i = _children.begin(); i != _children.end(); ++i) {
- rc = rc && (*i)->removeChild(obj, true);
+ rc = (*i)->removeChild(obj, true) && rc;
}
}
obj->_parent = 0L;
+
return rc;
}
|