summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-02-28 17:16:33 +0100
committerEike Rathke <erack@redhat.com>2017-02-28 17:17:37 +0100
commitd407791075ce4caff1259aa9a8ae573e4b7bb8bd (patch)
treed20a676f27aab8b85d9604ee0fbfbc58ba1f3db0
parent67070d583871ec77400b434b4f976c63768ad5b3 (diff)
dissolve() needs to delete head now that it's not a list element anymore
Change-Id: I9949a1006e6d1b4b50dd5350106ad69b643e833c
-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 b0e736be755b..2e084c6b8e33 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()