
Originally Posted by
wysota
Moreover, if you set an appropriate flag, the form will delete itself upon closing.
But it's still a memory leak 
void mainform::showForm() {
static Form2 *f2 = 0; // or declare f2 as a member variable
if( f2 == 0 ) {
f2 = new Form2();
}
f2->show();
f2->setActiveWindow();
f2->raise();
}
void mainform::showForm() {
static Form2 *f2 = 0; // or declare f2 as a member variable
if( f2 == 0 ) {
f2 = new Form2();
}
f2->show();
f2->setActiveWindow();
f2->raise();
}
To copy to clipboard, switch view to plain text mode
Bookmarks