From 047ce7abdd0f92e67e13ea2ea13656fba52caa04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Lucas=20Golini?= Date: Fri, 20 Mar 2026 12:40:40 -0300 Subject: [PATCH] Fix terminal close warning spawning multiple times and allowing to crash the app. --- src/tools/ecode/ecode.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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; } }