diff options
Diffstat (limited to 'Build/source/libs/graphite2/graphite2-src/src/Segment.cpp')
-rw-r--r-- | Build/source/libs/graphite2/graphite2-src/src/Segment.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Build/source/libs/graphite2/graphite2-src/src/Segment.cpp b/Build/source/libs/graphite2/graphite2-src/src/Segment.cpp index 980f68c3cbc..ecc35f50aa0 100644 --- a/Build/source/libs/graphite2/graphite2-src/src/Segment.cpp +++ b/Build/source/libs/graphite2/graphite2-src/src/Segment.cpp @@ -210,8 +210,13 @@ void Segment::freeSlot(Slot *aSlot) aSlot->attachedTo()->removeChild(aSlot); while (aSlot->firstChild()) { - aSlot->firstChild()->attachTo(NULL); - aSlot->removeChild(aSlot->firstChild()); + if (aSlot->firstChild()->attachedTo() == aSlot) + { + aSlot->firstChild()->attachTo(NULL); + aSlot->removeChild(aSlot->firstChild()); + } + else + aSlot->firstChild(NULL); } // reset the slot incase it is reused ::new (aSlot) Slot(aSlot->userAttrs()); |