When I delete a QML Object that contains a ChartView, everything works fine. The moment when I assign the "series" of the chart an ID, the destruction crashes.
Works fine:
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtCharts 2.2
ApplicationWindow {
visible: true
width: 640
height: 480
ChartView {
width: 450
height: 450
PieSeries {
PieSlice { label: "eaten"; value: 94.9 }
PieSlice { label: "not yet eaten"; value: 5.1 }
}
}
}
Crashes (see "id: testId in PieSeries):
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtCharts 2.2
ApplicationWindow {
visible: true
width: 640
height: 480
ChartView {
width: 450
height: 450
PieSeries {
id: testId
PieSlice { label: "eaten"; value: 94.9 }
PieSlice { label: "not yet eaten"; value: 5.1 }
}
}
}
just start/quit the program, and it will not exit correctly due to the crash on destruction. This happens with any ChartView / Series combination.
Starting build-ChartTest-Desktop_Qt_5_9_2_MSVC2015_64bit-Debug\debug\ChartTest.exe... QML debugging is enabled. Only use this in a safe environment. The program has unexpectedly finished. The process was ended forcefully.
stacktrace:
7 QtCharts::DeclarativePieSeries::~DeclarativePieSeries | qtchartsqml2d
8 QQmlPrivate::QQmlElement::~QQmlElement | qqmlprivate.h
9 QQmlPrivate::QQmlElement::`scalar deleting destructor' | qtchartsqml2d
10 QV4::QObjectWrapper::destroyObject qv4qobjectwrapper.cpp
11 QV4::MemoryManager::sweep | qv4mm.cpp
12 QV4::MemoryManager::~MemoryManager | qv4mm.cpp
13 QV4::MemoryManager::`scalar deleting destructor' | Qt5Qmld
14 QV4::ExecutionEngine::~ExecutionEngine | qv4engine.cpp
15 QV4::ExecutionEngine::`scalar deleting destructor' | Qt5Qmld