Don't use STL smart pointers with VST3 interfaces

This would cause double frees since those objects are supposed to clean
up after themselves.
This commit is contained in:
Robbert van der Helm
2020-12-07 18:09:49 +01:00
parent 75e8cf9140
commit d79bc3b936
3 changed files with 13 additions and 11 deletions
+4 -1
View File
@@ -62,4 +62,7 @@ TODO: Explain how we implement `createInstance()`
- Since everything behind the scenes makes use of these `addRef()` and
`release()` reference counting functions, we can't use the standard library's
smart pointers when dealing with objects that are shared with the host or with
the Windows VST3 plugin.
the Windows VST3 plugin. In `IPtr<T>`'s destructor it will call release, and
the objects will clean themselfs up with a `delete this;` when the reference
count reaches 0. Combining this with the STL cmart pointers this would result
in a double free.