fix vst3 for plugins without ui

This commit is contained in:
Stefano D'Angelo 2024-05-18 17:58:18 +02:00
parent 00cb0c37d8
commit 7b19769a65

View File

@ -1249,12 +1249,14 @@ static Steinberg_uint32 controllerRelease(controller *c) {
c->refs--; c->refs--;
if (c->refs == 0) { if (c->refs == 0) {
TRACE(" free %p\n", (void *)c); TRACE(" free %p\n", (void *)c);
#ifdef PLUGIN_UI
if (c->views) { if (c->views) {
for (size_t i = 0; i < c->viewsCount; i++) for (size_t i = 0; i < c->viewsCount; i++)
if (c->views[i]) // this should not happen but you never know if (c->views[i]) // this should not happen but you never know
plugViewRelease(c->views[i]); plugViewRelease(c->views[i]);
free(c->views); free(c->views);
} }
#endif
free(c); free(c);
return 0; return 0;
} }
@ -1822,8 +1824,10 @@ static Steinberg_tresult factoryCreateInstance(void *thisInterface, Steinberg_FI
c->refs = 1; c->refs = 1;
c->context = NULL; c->context = NULL;
c->componentHandler = NULL; c->componentHandler = NULL;
#ifdef PLUGIN_UI
c->views = NULL; c->views = NULL;
c->viewsCount = 0; c->viewsCount = 0;
#endif
*obj = c; *obj = c;
TRACE(" instance: %p\n", (void *)c); TRACE(" instance: %p\n", (void *)c);
} else { } else {