Segmentation fault fix
This commit is contained in:
parent
94c297ba88
commit
d3f5979873
|
@ -42,18 +42,20 @@ FDialog::FDialog (const FString& txt, FWidget* parent)
|
|||
//----------------------------------------------------------------------
|
||||
FDialog::~FDialog() // destructor
|
||||
{
|
||||
FApplication* fapp;
|
||||
|
||||
FApplication* fapp = static_cast<FApplication*>(getRootWidget());
|
||||
bool is_quit = fapp->isQuit();
|
||||
delete dialog_menu;
|
||||
dgl_menuitem = 0;
|
||||
delete accelerator_list;
|
||||
accelerator_list = 0;
|
||||
activatePrevWindow();
|
||||
|
||||
if ( ! is_quit )
|
||||
switchToPrevWindow();
|
||||
|
||||
delWindow(this);
|
||||
delDialog(this);
|
||||
fapp = static_cast<FApplication*>(getRootWidget());
|
||||
|
||||
if ( ! fapp->quit_now )
|
||||
if ( ! is_quit )
|
||||
{
|
||||
const FRect& geometry = getGeometryGlobalShadow();
|
||||
restoreVTerm (geometry);
|
||||
|
|
|
@ -69,7 +69,11 @@ FMenu::FMenu (const char* txt, FWidget* parent)
|
|||
//----------------------------------------------------------------------
|
||||
FMenu::~FMenu()
|
||||
{
|
||||
activatePrevWindow();
|
||||
FApplication* fapp = static_cast<FApplication*>(getRootWidget());
|
||||
|
||||
if ( ! fapp->isQuit() )
|
||||
switchToPrevWindow();
|
||||
|
||||
delWindow(this);
|
||||
|
||||
const FRect& geometry = getGeometryGlobalShadow();
|
||||
|
|
|
@ -177,6 +177,7 @@ FStatusBar::~FStatusBar()
|
|||
iter = keylist.erase(iter);
|
||||
}
|
||||
}
|
||||
setStatusBar(0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -537,7 +537,7 @@ void FWidget::setStatusBar (FStatusBar* sbar)
|
|||
if ( ! sbar || statusbar == sbar )
|
||||
return;
|
||||
|
||||
if ( statusbar )
|
||||
if ( statusbar && sbar != 0 )
|
||||
delete statusbar;
|
||||
|
||||
statusbar = sbar;
|
||||
|
|
Loading…
Reference in New Issue