diff --git a/src/tools/ecode/ecode.cpp b/src/tools/ecode/ecode.cpp index 98e1453b1..40f29b57a 100644 --- a/src/tools/ecode/ecode.cpp +++ b/src/tools/ecode/ecode.cpp @@ -4566,7 +4566,11 @@ void App::init( InitParameters& params ) { } else if ( mConfig.term.warnBeforeClosingTab && widget->isType( UI_TYPE_TERMINAL ) ) { UITerminal* term = widget->asType(); 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; } }