Data transfer from controller to view for spectrogram vst

Hello everyone,
I’m new to VST SDK, and for my first project, I’m creating a spectrogram plugin (purely visual, no parameters). I’ve got the processing down, and I created a custom CView that will display the spectrogram. For this, I’ve been following the answer provided in another thread (“Custom analyzer view” on this forum). If I understand correctly, having a custom subcontroller (inherited from DelegationController) allows me to “intercept” the view during verifyView when it is created so that I can pass data to the view from the controller. The only problem is that I don’t really know how to do this. I’ve tried creating a method in the view “setData” that is called by the subcontroller every time a new spectrum is sent from the processor to the controller, but I run into nullptr issues. I imagine this is due to the view and controller lifecycle that I don’t fully grasp. I believe this is the issue because he plugin crashes when closing the UI editor and reopening it a second time.
What would be an efficient way of implementing this? Shared data? Messaging?

I’ve provided the controller and view files.
spectro_plugin.zip (8,7 Ko)