globalParam is only one variable, so we can't delete it when there are two instances of the part running.

That fixes bug 81442
CCMAIL:81442-done@bugs.kde.org

svn path=/trunk/kdegraphics/kpdf/; revision=341419
This commit is contained in:
Albert Astals Cid 2004-08-26 16:54:06 +00:00
parent f705005d2f
commit 04ebb98aa2
2 changed files with 8 additions and 1 deletions

View file

@ -36,6 +36,8 @@ K_EXPORT_COMPONENT_FACTORY(libkpdfpart, KPDFPartFactory)
using namespace KPDF;
unsigned int Part::m_count = 0;
Part::Part(QWidget *parentWidget, const char *widgetName,
QObject *parent, const char *name,
const QStringList & /*args*/ )
@ -144,12 +146,15 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
connect( m_outputDev, SIGNAL( spacePressed() ), this, SLOT( slotReadDown() ) );
readSettings();
updateActionPage();
m_count++;
}
Part::~Part()
{
delete globalParams;
m_count--;
if (m_count == 0) delete globalParams;
writeSettings();
delete m_doc;
}
void Part::slotZoom( const QString&nz )

View file

@ -135,6 +135,8 @@ namespace KPDF
float m_zoomFactor;
int m_nextThumbnail;
static unsigned int m_count;
private slots:
void slotFitToWidthToggled();
void redrawPage();