Skip to content

fix client crash when removing agents from the ui #574

@skimask1690

Description

@skimask1690

Contact Details

No response

What happened?

// Erase NodeList after removeChild (client/src/UserInterface/Widgets/SessionGraph.cc)

void GraphWidget::GraphNodeRemove( SessionItem Session )
{
    for ( int i = 0; i < NodeList.size(); i++ )
    {
        if ( Session.Name.compare( NodeList[ i ]->Name ) == 0 )
        {
            GraphScene->removeItem( NodeList[ i ]->Node->NodeEdge );
            GraphScene->removeItem( NodeList[ i ]->Node );

            MainNode->Node->removeChild( NodeList[ i ]->Node );

            /* delete NodeList[ i ]->Node->NodeEdge;
            delete NodeList[ i ]->Node;
            delete NodeList[ i ]; */

            NodeList.erase( NodeList.begin() + i ); // fix is here

            return;
        }
    }
}

Did You Do a Pull First?

Latest (You performed a pull first)

Did You Try With the Dev Branch?

Yes (You tried using the dev branch but the problem persist)

Relevant log output

/usr/include/c++/15/bits/stl_vector.h:1263: constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = GraphWidget::Member*; _Alloc = std::allocator<GraphWidget::Member*>; reference = GraphWidget::Member*&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Error: signal: aborted

Did You Read Over Your Issue First?

  • I declare I made an effort and provided the necessary information for replication of the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions