Skip to content

Problem with SimulationBase in python module #330

@Tudor42

Description

@Tudor42

Hi,

There may be some a problem with SimulationBase cleanup as the module breaks when a second SimulationBase is created with the same scene file.

import pysplishsplash as sph
for _ in range(2):
    base = sph.Exec.SimulatorBase()

    curr = os.path.dirname(os.path.abspath(__file__))

    base.init(useGui=True, sceneFile=curr+'/scene.json', outputDir=curr, useCache=False)

    gui = sph.GUI.Simulator_GUI_imgui(base)
    base.setGui(gui)
    base.initSimulation()
    base.runSimulation()
    base.cleanup()

The scene is loaded normally the second time but the fluid model disappears on start, and getPosition returns Nan.

Additionally, the logger created in the constructor is not removed when the SimulationBase is destroyed, which leads to duplicated lines in the output.

The custom exporter feature can lead to NPE on python side at gc or at SimulationBase destruction as both try to cleanup the exporter pointer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions