I am updating our software to the latest VST2 SDK and VSTGUI, and have a question on how to use the newer SharedPointer that is returned from COffscreenContext::create(). The docs told me this:
COffscreenContext::create returns a SharedPointer now, not a naked pointer.
But I don’t know what I am supposed to do with a SharedPointer, as opposed to simply storing the COffscreenContext* that was returned previously. What do I declare as my class member, and how do I use it later? Do I just declare my member as SharedPointer instead of COffscreenContext*? And if I need to pass it around to existing functions that expect a COffscreen*, how do I do that?
And how do I dispose of it? Previously, I called forget() on the pointer and then set it to NULL, so that I could test its existence later, to be sure I didn’t use it or dispose of it again.
I don’t see any explanations about this in the SharedPointer documentation or header file. I am getting crashes when trying to store and use the raw pointer, so I assume this is the problem.