Fix bug when deleting an item in UIBuildSettings.

Improve LSPClientServer::shutdown.
Fix possible div / 0 in UIConsole.
This commit is contained in:
Martín Lucas Golini
2024-03-28 10:59:17 -03:00
parent bdcf47dfeb
commit 560733d25a
3 changed files with 43 additions and 27 deletions

View File

@@ -762,9 +762,9 @@ void UIBuildSettings::deleteStep( size_t stepNum, bool isClean ) {
// cppcheck-suppress mismatchingContainerIterator
steps.erase( steps.begin() + stepNum );
cont->findByClass<UIBuildStep>( String::toString( stepNum ) )->close();
for ( auto step = stepNum + 1; step < steps.size(); step++ )
for ( auto step = stepNum + 1; step <= steps.size(); step++ )
cont->findByClass<UIBuildStep>( String::toString( step ) )
->updateStep( step, &steps[step] );
->updateStep( step - 1, &steps[step - 1] );
}
} // namespace ecode