cspp
25th June 2009, 09:29
Hi all
I have an application with muti MainWindow. and thie close way:
The one way:
void MWindow::fileExit()
{
close(TRUE);
}
The another way:
void MWindow::closeEvent(QCloseEvent* ce)
{
penv->m_WindowList->GoHead(); //the list of all QMainWindow
do
{
if( pevn->m_WindowList->Object() == penv->currentWindow ) //
{
QMainWindow::closeEvent(ce);
break;
}
}
while(pevn->m_WindowList->GoNext())
}
The Destroy funtion
void MWindow::destroy()
{
//release the memory
}
My question is:
if I call the fileExit,it will call the destroy!
and if I click the close button on the QMainWindow,it will call the closeEvent,but not
call the destroy(),so my memery and GDI will leak!
and I want to how,if I want to support the close button, how I can do to avoid the memory and GDI leak.
Thanks.
PS:my platform is WinXp,Qt336,MSVC6.0.
I have an application with muti MainWindow. and thie close way:
The one way:
void MWindow::fileExit()
{
close(TRUE);
}
The another way:
void MWindow::closeEvent(QCloseEvent* ce)
{
penv->m_WindowList->GoHead(); //the list of all QMainWindow
do
{
if( pevn->m_WindowList->Object() == penv->currentWindow ) //
{
QMainWindow::closeEvent(ce);
break;
}
}
while(pevn->m_WindowList->GoNext())
}
The Destroy funtion
void MWindow::destroy()
{
//release the memory
}
My question is:
if I call the fileExit,it will call the destroy!
and if I click the close button on the QMainWindow,it will call the closeEvent,but not
call the destroy(),so my memery and GDI will leak!
and I want to how,if I want to support the close button, how I can do to avoid the memory and GDI leak.
Thanks.
PS:my platform is WinXp,Qt336,MSVC6.0.