summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-02-28 17:16:33 +0100
committerHenry Castro <hcastro@collabora.com>2017-05-02 17:07:17 -0400
commit695aefdf029c13490d6e289a30a8dc89993980a9 (patch)
tree3752207e3561c8f9cb34ebc8d2ab725284c9d8eb /sc
parentd356ef6846526724eab5b3990d7fff5bd33ef399 (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()