~QCustomPlot destructor includes following strings
mCurrentLayer = nullptr;
qDeleteAll(mLayers); // don't use removeLayer, because it would prevent the last layer to be removed
mLayers.clear();
Before call of qDeleteAll(mLayers); QList mLayers cosists of 6 members
- mLayers { size = 0x00000006 } QList<QCPLayer *>
+ [referenced] 0x00000001 std::atomic<int>
+ [0] 0x000001e7d9870700 {mParentPlot=0x000001e7d6ed99f0 {xAxis=0x0000 <NULL>
+ [1] 0x000001e7d986f980 {mParentPlot=0x000001e7d6ed99f0 {xAxis=0x0000 <NULL>
+ [2] 0x000001e7d98704c0 {mParentPlot=0x000001e7d6ed99f0 {xAxis=0x0000 <NULL>
+ [3] 0x000001e7d986f590 {mParentPlot=0x000001e7d6ed99f0 {xAxis=0x0000 <NULL>
+ [4] 0x000001e7d986f7d0 {mParentPlot=0x000001e7d6ed99f0 {xAxis=0x000000 <NULL>
+ [5] 0x000001e7d986f500 {mParentPlot=0x000001e7d6ed99f0 {xAxis=0x00000 <NULL>
and after the call
- mLayers { size = 0x00000006 } QList<QCPLayer *>
+ [referenced] 0x00000001 std::atomic<int>
+ [0] 0x000001e7d9870700 {mParentPlot=0xdddddddddddddddd {xAxis=??? yAxis=??? xAxis2=??? ..
+ [1] 0x000001e7d986f980 {mParentPlot=0xdddddddddddddddd {xAxis=??? yAxis=??? xAxis2=??? ..
+ [2] 0x000001e7d98704c0 {mParentPlot=0xdddddddddddddddd {xAxis=??? yAxis=??? xAxis2=??? ...
+ [3] 0x000001e7d986f590 {mParentPlot=0xdddddddddddddddd {xAxis=??? yAxis=??? xAxis2=??? ...
+ [4] 0x000001e7d986f7d0 {mParentPlot=0xdddddddddddddddd {xAxis=??? yAxis=??? xAxis2=??? ...
+ [5] 0x000001e7d986f500 {mParentPlot=0xdddddddddddddddd {xAxis=??? yAxis=??? xAxis2=??? ...
all layers have been destructed
Then call of mLayers.clear() causes crash