Hi, just learnt something so if someone wonder :
This is just a TFX wrapped into a Class
implementing the interface ITextureFX
note that the Operations Dispose
here is necessary.
Now here is a basic factory class using a switch :
Finally two ways to create a TFX on the fly using the Factory or just a Switch within the Cache Region :
The input pin Dispose Cached Outputs
must be set to true so when a change occurs on the Index
inputs and the cache region create a new TFX the Dispose
operation will be called.
If you don’t do that, then ==> Memory Leak <==
TFXFactoryAndCacheRegion.vl (27.8 KB)
Worth mentioning that if a node inside the class has a Dispose
operations then this will be enough to Dispose
the class that contains it.
More infos here : Creating and disposing VL.Audio player leaks memory? - #11 by tonfilm - question - Forum
Big thanks to @tonfilm