Kaydet (Commit) d4077910 authored tarafından Eike Rathke's avatar Eike Rathke

dissolve() needs to delete head now that it's not a list element anymore

Change-Id: I9949a1006e6d1b4b50dd5350106ad69b643e833c
üst 67070d58
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment