Skip to content

Can't run navMesh more than once #158

@MichelangeloDiamanti

Description

@MichelangeloDiamanti

Hello,

As mentioned in the title I am having problems running any project employing navMesh as a velocity component more than once in a row. Everything works the first time I run the project, but the second time it throws a read access violation exception. This is the case only for projects that use NavMesh as a velocity component, in fact I can run the 4square example (which uses a K/D tree) repeatedly without any issue. I recorded a short video to better explain the issue:

problem_with_menge_navMesh_compressed.mp4

I initially discovered this issue on the MengeUnity project, which loads menge as an external DLL. In this case, the application loads and initializes the simulator, and then should be able to call the simulator more than once on any example (at least once every time the "play button" is pressed). So, when I tried running the navMesh example with Unity, it crashed the editor every other time. Then I traced back the issue to the main Menge application, and in the video you can see that it throws the read access violation. I tried to investigate the issue further, and I believe it is tied to the fact that the navMesh is never "cleaned up". In fact, putting some breakpoint in the Destructor of the navMesh class, I determined that those are never hit during execution, and the "Clear()" function is never called.

image

If that is the case, I think that after the first run, the simulator might be left in an inconsistent state, and that raises the exception. That would also explain why this happens only when the navMesh is involved. In fact, the K/D tree example works as intended, the destuctor gets called, and the simulation can be run multiple times. I would appreciate any help on this matter, thanks :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions