Fix crash on Linux
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include <QtWidgets/QStyledItemDelegate>
|
#include <QtWidgets/QStyledItemDelegate>
|
||||||
|
|
||||||
|
#include "wx/app.h"
|
||||||
#include "wx/textctrl.h"
|
#include "wx/textctrl.h"
|
||||||
|
|
||||||
#include "treeitemfactory.h"
|
#include "treeitemfactory.h"
|
||||||
@@ -35,9 +36,12 @@ public:
|
|||||||
|
|
||||||
void destroyEditor(QWidget *WXUNUSED(editor), const QModelIndex &WXUNUSED(index)) const wxOVERRIDE
|
void destroyEditor(QWidget *WXUNUSED(editor), const QModelIndex &WXUNUSED(index)) const wxOVERRIDE
|
||||||
{
|
{
|
||||||
m_current_model_index = QModelIndex();
|
if (!wxTheApp->IsScheduledForDestruction(m_textCtrl))
|
||||||
delete m_textCtrl;
|
{
|
||||||
m_textCtrl = NULL;
|
m_current_model_index = QModelIndex();
|
||||||
|
wxTheApp->ScheduleForDestruction(m_textCtrl);
|
||||||
|
m_textCtrl = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setModelData(QWidget *WXUNUSED(editor), QAbstractItemModel *WXUNUSED(model), const QModelIndex &WXUNUSED(index)) const wxOVERRIDE
|
void setModelData(QWidget *WXUNUSED(editor), QAbstractItemModel *WXUNUSED(model), const QModelIndex &WXUNUSED(index)) const wxOVERRIDE
|
||||||
|
Reference in New Issue
Block a user