mirror of
https://invent.kde.org/graphics/okular
synced 2024-09-13 05:01:30 +00:00
Do not delete m_annowindows directly
If we do that slotAnnotationWindowDestroyed bites us and the list gets out of sync
This commit is contained in:
parent
d34bc7f263
commit
5e6e54dbb0
|
@ -383,7 +383,13 @@ PageView::~PageView()
|
||||||
d->m_tts->stopAllSpeechs();
|
d->m_tts->stopAllSpeechs();
|
||||||
|
|
||||||
// delete the local storage structure
|
// delete the local storage structure
|
||||||
qDeleteAll(d->m_annowindows);
|
|
||||||
|
// We need to assign it to a different list otherwise slotAnnotationWindowDestroyed
|
||||||
|
// will bite us and clear d->m_annowindows
|
||||||
|
QHash< Okular::Annotation *, AnnotWindow * > annowindows = d->m_annowindows;
|
||||||
|
d->m_annowindows.clear();
|
||||||
|
qDeleteAll( annowindows );
|
||||||
|
|
||||||
// delete all widgets
|
// delete all widgets
|
||||||
QVector< PageViewItem * >::const_iterator dIt = d->items.constBegin(), dEnd = d->items.constEnd();
|
QVector< PageViewItem * >::const_iterator dIt = d->items.constBegin(), dEnd = d->items.constEnd();
|
||||||
for ( ; dIt != dEnd; ++dIt )
|
for ( ; dIt != dEnd; ++dIt )
|
||||||
|
@ -889,8 +895,11 @@ void PageView::notifySetup( const QVector< Okular::Page * > & pageSet, int setup
|
||||||
|
|
||||||
updateActionState( haspages, documentChanged, hasformwidgets );
|
updateActionState( haspages, documentChanged, hasformwidgets );
|
||||||
|
|
||||||
qDeleteAll( d->m_annowindows );
|
// We need to assign it to a different list otherwise slotAnnotationWindowDestroyed
|
||||||
|
// will bite us and clear d->m_annowindows
|
||||||
|
QHash< Okular::Annotation *, AnnotWindow * > annowindows = d->m_annowindows;
|
||||||
d->m_annowindows.clear();
|
d->m_annowindows.clear();
|
||||||
|
qDeleteAll( annowindows );
|
||||||
|
|
||||||
selectionClear();
|
selectionClear();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue