Xmodal / autonomX

Experiment with life-like processes to generate dynamic, emergent and self-organizing patterns and output these patterns via OSC.
10 stars 4 forks source link

Generator::resetRegions() method called from computeThread causes crash #375

Open jvlyndark opened 3 years ago

jvlyndark commented 3 years ago

Due to threading issues, the Generator::resetRegions() method cannot be called from the computeThread (which contains Generator + its descendant classes and ComputeEngine). This is because the GeneratorRegionSets, which are responsible for creating, destroying, and resetting generator I/O regions, have been consciously moved to the mainThread

As a result, calling resetRegions() by the class that implements it (Generator), or any class on computeThread, causes the program crash.

Instead, resetRegions() must be called on mainThread by the GeneratorModel class (see example in Header.qml, line 192), which connects to the GeneratorFacade associated with the specific Generator. This is done to allow the generator facades to more seamlessly connect with the QML Engine / UI which also live on mainThread.

Possible fixes include: