QgsLayerTreeEmbeddedWidgetRegistry::~QgsLayerTreeEmbeddedWidgetRegistry()
{
  const auto constMProviders = mProviders;
  for ( QgsLayerTreeEmbeddedWidgetProvider *provider : constMProviders )
  {
    removeProvider( provider->id() );
  }
}
 Q_FOREACH ( QgsProcessingProvider* p, mProviders )
 {
   removeProvider( p );
 }