RustAudio / vst3-sys

Raw Bindings to the VST3 API
Other
284 stars 18 forks source link

Use atomics for the internal reference count #46

Closed robbert-vdh closed 2 years ago

robbert-vdh commented 2 years ago

This mirrors the VST3 SDK's implementation. In practice using regular integers will not cause any issues since the host will usually not query and destroy interface objects from different threads at the same time, but when using atomics those situations where that does happen are also safe.

robbert-vdh commented 2 years ago

Maybe it should be a separate PR, but I also noticed that the return type of IParamValueQueue::add_parameter_data was incorrect, so I fixed that as well.

robbert-vdh commented 2 years ago

And another fix, which fixes cross compilation between WIndows and non-Windows OS'.

robbert-vdh commented 2 years ago

I tacked on another fix.

Apparently if you had a pub field in your class, the proc macro would generate a pub function parameter...