How do I delete an allocated array when I close the plugin?

My goal is to have an array that is some power of two in size so I can run it through an FFT algorithm. I would like to delete the array when I delete the plugin. I tried overriding the destructor of the IPlugProcessor to also delete the array, but I get an error because the other variables are inaccessible (mChannelData and mIOConfigs). Why does this happen? is there a keyword I am missing?

Alternatively, is there a better way to do FFT processing? I’m new to audio programming so bear with me

// updated destructor

  delete[] array;

// ^^ each of these three give errors

The destructor of IPlugProcessor will still get called if you implement a destructor in your plugin.

Rather than use a C Style array, try using std::vector<float> mArray; This will manage the deallocation for you when it goes out of scope.

I was originally using them, but I was afraid that there might be a lot of unnecessary calculations happening downstairs that I could avoid by creating and operating my own arrays. Are there any unnecessary calculations that a vector would require? Are they negligible in this situation?