我在qgis 2.8.1((使用qwt6的32位版本)我的插件中使用qwt5)。當我運行我的C++程序時,它崩潰與此錯誤:崩潰:這可能是由於堆的腐敗
問題發生在這個函數(在調試運行):
QwtPlotItemIterator it = list.begin();
while (it != list.end())
{
QwtPlotItem *item = *it;
++it; // increment before removing item from the list
item->attach(NULL);
delete item;
}
:
//delete all the items attached to QwtPlot
const QwtPlotItemList &list = m_pPlot->itemList();
qDeleteAll(list.begin(), list.end());
我換成這個功能
但在這個指令再次出現死機一樣:
delete item;
請,你有沒有對這個問題的想法?
輸出窗口可能有更多診斷信息。 HEAP [qgis-bin.exe]:指定給RtlFreeHeap的無效地址(02D20000,123B6D10) Windows在qgis-bin.exe中觸發了一個斷點。 這可能是由於堆損壞引起的,這表明qgis-bin.exe或任何已加載的DLL中存在錯誤。 這也可能是由於用戶在qgis-bin.exe具有焦點時按下F12。 –