there are still cases where the caption pointer is dangling
Change-Id: I8c186fa32d7fc3f26d7952268cb1e614025ecf37
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 02502ed..d2ef02f 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -692,6 +692,10 @@ void ScCaptionPtr::decRefAndDestroy()
assert(!mpNext); // this must be one and only one
assert(mpCaption);
#if 1
// FIXME: there are still cases where the caption pointer is dangling
mpCaption = nullptr;
#else
// Destroying Draw Undo deletes its SdrObject, don't attempt that twice.
if (!mbInUndo)
{
@@ -705,6 +709,7 @@ void ScCaptionPtr::decRefAndDestroy()
SdrObject::Free( pObj );
}
}
#endif
delete mpHead;
mpHead = nullptr;
}