mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Plugins - Don't dispose Plugin when disabling after it has been injected into a feature
This commit is contained in:
1 parent
75d85985a9
commit
289a411545
9 files changed
+58
-33
No files matched your search
@@ -97,7 +97,7 @@ namespace Artemis.UI.Shared
|
||||
/// Occurs when a LED of the device has been clicked
|
||||
/// </summary>
|
||||
public event EventHandler<LedClickedEventArgs>? LedClicked;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Occurs when the device was clicked but not on a LED.
|
||||
/// </summary>
|
||||
@@ -259,8 +259,6 @@ namespace Artemis.UI.Shared
|
||||
|
||||
private void SetupForDevice()
|
||||
{
|
||||
_deviceImage?.Dispose();
|
||||
_deviceImage = null;
|
||||
_highlightedLeds = new List<DeviceVisualizerLed>();
|
||||
_dimmedLeds = new List<DeviceVisualizerLed>();
|
||||
|
||||
@@ -296,7 +294,11 @@ namespace Artemis.UI.Shared
|
||||
Task.Run(() =>
|
||||
{
|
||||
if (device.Layout?.Image == null || !File.Exists(device.Layout.Image.LocalPath))
|
||||
{
|
||||
_deviceImage?.Dispose();
|
||||
_deviceImage = null;
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@@ -312,6 +314,7 @@ namespace Artemis.UI.Shared
|
||||
deviceVisualizerLed.DrawBitmap(context);
|
||||
}
|
||||
|
||||
_deviceImage?.Dispose();
|
||||
_deviceImage = renderTargetBitmap;
|
||||
|
||||
Dispatcher.UIThread.Post(InvalidateMeasure);
|
||||
@@ -337,7 +340,5 @@ namespace Artemis.UI.Shared
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -44,6 +44,10 @@
|
||||
<ToggleButton Classes="icon-button">
|
||||
<avalonia:MaterialIcon Kind="BlockChain" />
|
||||
</ToggleButton>
|
||||
|
||||
<Button Classes="icon-button">
|
||||
<avalonia:MaterialIcon Kind="Cog" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Design.PreviewWith>
|
||||
|
||||
Reference in new issue
Block a user