QPersistentModelIndex coring on destruction
-
Hi,
I am using qt 4.8 c++ and I am running into an interesting issue. I am working on some code I inherited and occasionally my process will crash when destroying a view. It looks like it is getting a sigserv when trying delete a QModelIndex. Is there a way to protect against double freeing a QModelIndex? I am new to Qt so my apologies if my question does not make sense.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007f4551ed6ba0 in QHash<QModelIndex, QPersistentModelIndexData*>::remove(QModelIndex const&) ()
from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
[Current thread is 1 (Thread 0x7f4559248d40 (LWP 23319))]
(gdb) bt
#0 0x00007f4551ed6ba0 in QHash<QModelIndex, QPersistentModelIndexData*>::remove(QModelIndex const&) ()
from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
#1 0x00007f4551ecee04 in QAbstractItemModelPrivate::removePersistentIndexData(QPersistentModelIndexData*)
() from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
#2 0x00007f4551ecf199 in QPersistentModelIndexData::destroy(QPersistentModelIndexData*) ()
from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
#3 0x00007f4551ecf1df in QPersistentModelIndex::~QPersistentModelIndex() ()
from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
#4 0x00007f455292c0ae in QAbstractItemViewPrivate::~QAbstractItemViewPrivate() ()
from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtGui.so.4
#5 0x00007f4552978b77 in QTreeViewPrivate::~QTreeViewPrivate() ()
from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtGui.so.4
#6 0x00007f4551ef33f5 in QObject::~QObject() ()
from /privdir/igen029/Downloads/tshui_1574270067447/solibs/libQtCore.so.4
#7 0x00007f455245d46c in QWidget::~QWidget() ( -
Please show the complete backtrace. I would guess you're trying to delete an object/widget twice.