wxFreeChart 示例程序退出时错误信息

该示例程序运行良好,除了退出时出现下图:

原因:wxAuiManager需在主窗口析构时呼叫UnInit().文档:

void wxAuiManager::UnInit()

Uninitializes the framework and should be called before a managed frame or window is destroyed.

UnInit() is usually called in the managed wxFrame's destructor. It is necessary to call this function before the managed frame or window is destroyed, otherwise the manager cannot remove its custom event handlers from a window.

解决方案:

sample/demo.cpp,line 139:

1 MainFrame::~MainFrame()
2 {
3     
4 }

插入:

MainFrame::~MainFrame()
{
    wxAuiManager::GetManager(this)->UnInit();
}
View Code

问题解决。

原文地址:https://www.cnblogs.com/godspeedsam/p/3838626.html