Commit bc2bc6f0 authored by Shubham  .'s avatar Shubham .
Browse files

Fix crash on switching

parent 8b127f26
......@@ -233,8 +233,8 @@ DocumentationPanelWidget::DocumentationPanelWidget(QWidget* parent) : QWidget(pa
//delete m_index; //this crashes
// delete m_content;
delete m_index; //this crashes
delete m_content;
delete m_engine;
delete m_textBrowser;
delete m_displayArea;
......@@ -246,14 +246,14 @@ DocumentationPanelWidget::~DocumentationPanelWidget()
void DocumentationPanelWidget::updateBackend(const QString& newBackend, const QString& icon)
if(m_backend == newBackend)
// If new backend is same as the backend of the documentation panel,
// then do nothing because it is already open
qDebug()<<"Previous backend " << m_backend;
qDebug()<<"New backend " << newBackend;
if(m_backend == newBackend)
m_backend = newBackend;
// remove previous widgets over display belonging to previous backends
......@@ -300,7 +300,6 @@ void DocumentationPanelWidget::updateDocumentation()
// initialize the Qt Help engine and provide the proper help collection file for the current backend
const QString& fileName = QStandardPaths::locate(QStandardPaths::AppDataLocation,
QLatin1String("documentation/") + m_backend + QLatin1String("/help.qhc"));
delete m_engine; // delet last backend's help engine
m_engine = new QHelpEngine(fileName, this);
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