Skip to content

run treadmill on-demand and shutdown when no ugen uses it

Lennart Melzer requested to merge feature/25-reference-counting into main

This PR will switch to running the treadmill thread only when a ugen is actually using it.

All Ugens now have a destructor that will decrement the use counter for the treadmill and, if needed stops it.

In order to check whether this works, I used htop (which may be installable on macOS via brew install htop). This allows filtering processes by name and inspecting its thread (they show in a different color). Then I used a simple test to check if destructing e.g. OmegaButton leads to stopping of the thread.

Please test on real hardware...

closes #25

Merge request reports