okular: remove the TOC observer before closing the document

fixes crash in case the part is embeded and the parent is closed

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-06-20 18:34:58 +03:00
parent 17efba129e
commit ca5dc4efc0

View file

@ -803,6 +803,7 @@ Part::~Part()
{
GuiUtils::removeIconLoader( iconLoader() );
m_document->removeObserver( this );
m_document->removeObserver( m_toc );
if ( m_document->isOpened() )
Part::closeUrl( false );