View Single Post
Old 11-11-2020, 03:17 AM   #1
SaschArt
Human being with feelings
 
SaschArt's Avatar
 
Join Date: Aug 2013
Posts: 236
Default Static variables in functions are safe?

Is it safe to work with static variables in functions? For example, if I use this variable in the OnParamChange function
Code:
void VSTCLASS::OnParamChange(int id) {
	IMutexLock lock(this);
	static float last_val;
....
If the user loads multiple instances of my plugin on the same Host, is there a risk that the variable will become global for all these instances? Since I use the same name for the class and the same variable name?
__________________
Audio plugins | BrainWaveProducer | EmRysRa
SaschArt is offline   Reply With Quote