I am using Qt 4.7.3 and create a QML component in C++ (inherits QDeclarativeItem), I found it will crash in the QGraphicsItem's destructor.
After trace into the code, I found the code snippet seems wrong.
qgraphicsitem.cpp line:1479
if (!d_ptr->children.isEmpty()) {
while (!d_ptr->children.isEmpty())
delete d_ptr->children.first();
Q_ASSERT(d_ptr->children.isEmpty());
}
The code won't remove the first element after deleted it, and than delete the first element again, so it cause double-free and the program crash.
Have anyone meet this situation?
Bookmarks