From 5b514ff9629d756c36c769bfa1055cbac0f8c079 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sat, 8 Apr 2023 14:42:56 +0200 Subject: [PATCH] Moved reference check for UpdateQueue disposal to the caller to prevent issues with Dispose-overrides --- RGB.NET.Core/Devices/AbstractRGBDevice.cs | 3 ++- RGB.NET.Core/Update/Devices/UpdateQueue.cs | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/RGB.NET.Core/Devices/AbstractRGBDevice.cs b/RGB.NET.Core/Devices/AbstractRGBDevice.cs index faaf147..596625c 100644 --- a/RGB.NET.Core/Devices/AbstractRGBDevice.cs +++ b/RGB.NET.Core/Devices/AbstractRGBDevice.cs @@ -162,7 +162,8 @@ public abstract class AbstractRGBDevice : Placeable, IRGBDevice : AbstractReferenceCountin } /// - /// - /// Disposes this queue. - /// Checks if any referencing objects are registered and if so, will return without disposing! - /// public virtual void Dispose() { - if (this.HasActiveReferences()) return; - _updateTrigger.Starting -= OnStartup; _updateTrigger.Update -= OnUpdate;