summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-02-28 17:16:33 +0100
committerJan Holesovsky <kendy@collabora.com>2017-05-15 21:58:54 +0200
commit85ba0caf47f43c1542762c0b13793d6958f80ad0 (patch)
tree303078aa5434fa37156c73c68dbf08f44ea020dd /sc
parent318ded2d7b9a03c8f76e2adda50997d5352e5607 (diff)
dissolve() needs to delete head now that it's not a list element anymore
Change-Id: I9949a1006e6d1b4b50dd5350106ad69b643e833c
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/postit.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 0f456611eebb..9f25cfe6ab9b 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -665,15 +665,18 @@ bool ScCaptionPtr::forget()
void ScCaptionPtr::dissolve()
{
+ ScCaptionPtr::Head* pHead = mpHead;
ScCaptionPtr* pThat = (mpHead ? mpHead->mpFirst : this);
while (pThat)
{
- assert(!pThat->mpNext || mpHead); // next without head is bad
+ assert(!pThat->mpNext || pThat->mpHead); // next without head is bad
+ assert(pThat->mpHead == pHead); // same head required within one list
ScCaptionPtr* p = pThat->mpNext;
pThat->clear();
pThat = p;
}
- clear();
+ assert(!mpHead && !mpNext && !mpCaption); // should had been cleared during list walk
+ delete pHead;
}
void ScCaptionPtr::clear()