From a host point of view, what is the proper way to delete a plugin?

From a host point of view, what is the proper way to delete a plugin to make sure that the memory is freed and we don’t get a memory leak?

The following seems not to release all memory. Is the order ok? Should I also delete some of these objects?

//=======================
if(steinbergPlatform) steinbergPlatform->quit();
if(component) component->terminate();
if(component2) component2->terminate();
if(editController) editController->terminate();
if(editController2) editController2->terminate();
if(plugProvider) plugProvider->release();
if(plugProvider2) plugProvider2->release();
//=========================

Thank you very much for your help!