From 2936fd2b41cdde957ae12c44a2dc914d97190a11 Mon Sep 17 00:00:00 2001 From: Hemant Kumar Date: Sun, 7 Sep 2014 13:58:24 -0400 Subject: [PATCH] Fix crash on closing a tab --- rbkit-lib/heapdumpform.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/rbkit-lib/heapdumpform.cpp b/rbkit-lib/heapdumpform.cpp index 275d08c..fbb0d3d 100644 --- a/rbkit-lib/heapdumpform.cpp +++ b/rbkit-lib/heapdumpform.cpp @@ -28,7 +28,6 @@ HeapDumpForm::HeapDumpForm(QWidget* parent, int _snapShotVersion) HeapDumpForm::~HeapDumpForm() { delete ui; - delete proxyModel; delete model; delete rootItem; } @@ -45,9 +44,9 @@ void HeapDumpForm::loaData() { rootItem = RBKit::SqlConnectionPool::getInstance()->rootOfSnapshot(snapShotVersion); model = new RBKit::HeapDataModel(rootItem, this); - proxyModel = new SortObjectProxyModel(this); - proxyModel->setSourceModel(model); - ui->treeView->setModel(proxyModel); +// proxyModel = new SortObjectProxyModel(this); +// proxyModel->setSourceModel(model); + ui->treeView->setModel(model); adjustColumnWidth(); } @@ -55,9 +54,9 @@ void HeapDumpForm::loadSelectedReferences(RBKit::HeapItem *_selectedItem) { rootItem = _selectedItem->getSelectedReferences(); model = new RBKit::HeapDataModel(rootItem, this); - proxyModel = new SortObjectProxyModel(this); - proxyModel->setSourceModel(model); - ui->treeView->setModel(proxyModel); +// proxyModel = new SortObjectProxyModel(this); +// proxyModel->setSourceModel(model); + ui->treeView->setModel(model); adjustColumnWidth(); } @@ -76,7 +75,7 @@ void HeapDumpForm::onCustomContextMenu(const QPoint &point) if (disableRightClick) return; QPoint localPoint = ui->treeView->viewport()->mapToGlobal(point); - QModelIndex index = proxyModel->mapToSource(ui->treeView->indexAt(point)); + QModelIndex index = ui->treeView->indexAt(point); if (index.isValid()) { selecteItem = static_cast(index.internalPointer()); QMenu menu(this);