mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
Fix terminal close warning spawning multiple times and allowing to crash the app.
This commit is contained in:
@@ -4566,7 +4566,11 @@ void App::init( InitParameters& params ) {
|
||||
} else if ( mConfig.term.warnBeforeClosingTab && widget->isType( UI_TYPE_TERMINAL ) ) {
|
||||
UITerminal* term = widget->asType<UITerminal>();
|
||||
ProcessID pid = term->getTerm()->getTerminal()->getProcess()->pid();
|
||||
std::string msgBoxId = String::format( "msgbox_%p", this );
|
||||
if ( Sys::processHasChildren( pid ) ) {
|
||||
if ( nullptr != getUISceneNode()->find( msgBoxId ) )
|
||||
return false;
|
||||
|
||||
UIMessageBox* msgBox = UIMessageBox::New(
|
||||
UIMessageBox::OK_CANCEL,
|
||||
i18n( "terminal_close_warn", "Are you sure you want to close this "
|
||||
@@ -4584,6 +4588,7 @@ void App::init( InitParameters& params ) {
|
||||
msgBox->setTitle( "ecode" );
|
||||
msgBox->center();
|
||||
msgBox->showWhenReady();
|
||||
msgBox->setId( msgBoxId );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user