Profiles - Dispose WIP

This commit is contained in:
SpoinkyNL committed 2020-08-09 22:34:45 +02:00
1 parent 1f70c65651
commit c0bdd8cf26
26 files changed
+246 -105

No files matched your search

@@ -131,14 +131,14 @@ namespace Artemis.Core.Plugins.Abstract
internal void ChangeActiveProfile(Profile profile, ArtemisSurface surface)
{
if (profile != null && profile.PluginInfo != PluginInfo)
throw new ArtemisCoreException($"Cannot activate a profile of plugin {profile.PluginInfo} on a module of plugin {PluginInfo}.");
if (profile != null && profile.Module != this)
throw new ArtemisCoreException($"Cannot activate a profile of module {profile.Module} on a module of plugin {PluginInfo}.");
lock (this)
{
if (profile == ActiveProfile)
return;
ActiveProfile?.Deactivate();
ActiveProfile?.Dispose();
ActiveProfile = profile;
ActiveProfile?.Activate(surface);
@@ -80,8 +80,9 @@ namespace Artemis.Core.Plugins.LayerBrush.Abstract
public void Dispose()
{
DisableLayerBrush();
BaseProperties.Dispose();
Dispose(true);
GC.SuppressFinalize(this);
}
@@ -106,6 +106,7 @@ namespace Artemis.Core.Plugins.LayerEffect.Abstract
public void Dispose()
{
DisableLayerEffect();
BaseProperties.Dispose();
}
/// <summary>