Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frequent death of application when clearing the simulation editor panel (Windows) #94

Open
ynedelec3 opened this issue Aug 3, 2022 · 2 comments

Comments

@ynedelec3
Copy link
Collaborator

ynedelec3 commented Aug 3, 2022

Hi
After a long pause in Using Irritator I came back to the latest version and installed it on windows quite easily and successfully.
However an assert instruction frequently kills the application when clearing (by clicking on "Clear" button) the simulation editor panel.

The line responsible for this is the commented one in :

template<typename Dynamics>
static void add_output_attribute(simulation_editor& ed,
                                 const Dynamics&    dyn) noexcept
{
    if constexpr (is_detected_v<has_output_port_t, Dynamics>) {
        const auto** names  = get_output_port_names<Dynamics>();
        const auto&  mdl    = get_model(dyn);
        const auto   mdl_id = ed.sim.models.get_id(mdl);

        sz i = 0;
        for ([[maybe_unused]] auto& elem : dyn.y) {
            irt_assert(i < 8u);

            //assert(ed.sim.models.try_to_get(mdl_id) == &mdl); //xxx Nedelec

            ImNodes::BeginOutputAttribute(make_output_node_id(mdl_id, (int)i),
                                          ImNodesPinShape_TriangleFilled);
            ImGui::TextUnformatted(names[i]);
            ImNodes::EndOutputAttribute();
            ++i;
        }
    }
}

[simulation-editor.cpp]

I couldn't identify a reason for these fatal errors nor any faulty order in instructions prior to its happening, it occurs after a while but sometimes quickly, sometimes after a few successful imports.
I commented the instruction but I guess it's not a good idea.

It does not change the simulation quality so i just report the situation.

Have a nice summer
Yves

@quesnel
Copy link
Member

quesnel commented Aug 4, 2022 via email

@ynedelec3
Copy link
Collaborator Author

ynedelec3 commented Aug 5, 2022

Hi
The assert instruction appears in line 43 and line 67, both lines may bug (code pasted above comes from only one occurrence)

@ynedelec3 ynedelec3 changed the title Frequent application death when clearing the simulation editor panel (Windows) Frequent death of application when clearing the simulation editor panel (Windows) Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants