Commit aed8a9b3 authored by Albert Astals Cid's avatar Albert Astals Cid

Fix crash on closing

Tell the document we're no longer an observer in the destructor
BUGS: 346149
FIXED-IN: KDE Applications 15.04.1
parent 7f6c9987
......@@ -35,6 +35,12 @@ MagnifierView::MagnifierView(Okular::Document* document, QWidget* parent)
, m_document(document)
, m_page(0)
{
document->addObserver(this);
}
MagnifierView::~MagnifierView()
{
m_document->removeObserver(this);
}
void MagnifierView::notifySetup(const QVector< Okular::Page* >& pages, int setupFlags)
......
......@@ -30,6 +30,7 @@ class MagnifierView : public QWidget, public Okular::DocumentObserver
public:
MagnifierView( Okular::Document *document, QWidget *parent = 0 );
~MagnifierView();
void notifySetup( const QVector< Okular::Page * > & pages, int setupFlags );
void notifyPageChanged( int page, int flags );
......
......@@ -396,7 +396,6 @@ PageView::PageView( QWidget *parent, Okular::Document *document )
d->magnifierView = new MagnifierView(document, this);
d->magnifierView->hide();
d->magnifierView->setGeometry(0, 0, 351, 201); // TODO: more dynamic?
document->addObserver(d->magnifierView);
connect(document, SIGNAL(processMovieAction(const Okular::MovieAction*)), this, SLOT(slotProcessMovieAction(const Okular::MovieAction*)));
connect(document, SIGNAL(processRenditionAction(const Okular::RenditionAction*)), this, SLOT(slotProcessRenditionAction(const Okular::RenditionAction*)));
......
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