【发布时间】:2014-09-30 05:18:42
【问题描述】:
我注意到在 QT 5 示例中没有分配新小部件的删除调用。
在这个例子中是否意味着
using namespace std;
#include <QApplication>
#include <QMainWindow>
#include <QTabWidget>
//This is to be used in many files later until the code exits
short * AA = new short[1000000];
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MyTabDialog w;
w.show();
delete[] AA;
return app.exec();
}
不需要删除调用或它的位置错误?
谢谢
【问题讨论】:
-
Memory management in Qt? 的可能重复项
-
@MrEricSir 该问题的答案不包括在堆栈中分配的 QObjects,
w就是这种情况。