View Single Post
Old 10-19-2017, 08:09 AM   #11
1eqinfinity
Human being with feelings
 
Join Date: Apr 2014
Posts: 84
Default

As soon as you AttachControl() IGraphics owns it. More accurately, as long as the pointer to the control is in mControls member of IGraphics. So it will be deleted in the ~IGraphics().
Trying to delete already deleted object is undefined behaviour. You may be lucky and not catch runtime error, but I personally did catch a bunch of those during some experiments with IControls.
If you new(something) in your custom IControl class, you should delete(something).
However, it is always better to use smart pointers. Compared to audio thread graphics thread is not time critical at all, so there's no practical performance issue with that even when you have hundreds of controls.

Ideally, as I understand it, an audio plugin developer shouldn't worry about loading/unloading dlls. That is another layer of abstraction, that stuff should be handled by the framework and hosts. The developer writes code in correspondence with the framework logic and common sense
__________________
soundcloud.com/crimsonbrain

Last edited by 1eqinfinity; 10-19-2017 at 08:18 AM.
1eqinfinity is offline   Reply With Quote