Hi,
thank you for your answers!
as I said in my first post, the widget parent change anything for my memory leaks but I agree this creation on the main window isn't correct. So I change my code with this, I removed all not important things to get a more basic application :
@QDialogTestWindow::~QDialogTestWindow(void)
{
MY_DELETE(m_qDialog);
}
void QDialogTestWindow::Initialize()
{
// In this case, give a parent in constructor of widget, layout change nothing, they can be null.
m_qDialog = MY_NEW(QDialog,AID_QT)(this);
QPushButton* pushButton = MY_NEW(QPushButton,AID_QT)(m_qDialog);
//QPushButton* pushButton = MY_NEW(QPushButton,AID_QT)(this);
//QPushButton* pushButton = MY_NEW(QPushButton,AID_QT)();
QMenuBar* menubar = MY_NEW(QMenuBar,AID_QT)(this);
QMenu* menuFile = menubar->addMenu("File");
m_action = MY_NEW(QAction,AID_QT)(this);
menuFile->addAction(m_action);
connect(m_action, SIGNAL(triggered()), m_qDialog, SLOT(show()));
setMenuBar(menubar);
//m_action->trigger();
//m_qDialog->show();
}
void QDialogTestWindow::closeEvent( QCloseEvent *e )
{
// Close the QDialog before quit the qApp, but it's doesn't affect the memory leak...
//if(m_qDialog->isVisible())
//m_qDialog->close();
qApp->quit();
}@
I run my application on windows x86, it's same thing with x64 with others memory leaks size naturally.
I didn't tried external memory testing tools.
I found one thing: when I use show() of the QDialog instead use the m_action to show the QDialog, I haven't memory leaks!
It's weird because if I use close() method of the QDialog in the closeEvent() of my MainWindow
instead close manually my QDialog, I get the memory leaks... When I close manually the QDialog, I haven't the issue.
An other thing, if I don't instanciate my QPushButton, whatever the parent, I haven't memory leak!
So, I will watch the destructor more in details.