chore: update plan for finalizer removal

This commit is contained in:
copilot-swe-agent[bot] 2026-06-05 20:43:17 +00:00 committed by GitHub
parent b86f2df89b
commit cffcfbbda1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -119,6 +119,9 @@ namespace PepperDash.Essentials.Core
/// </summary>
~ComPortController()
{
if (Port == null)
return;
Port.SerialDataReceived -= Port_SerialDataReceived;
}
@ -156,6 +159,9 @@ namespace PepperDash.Essentials.Core
/// <inheritdoc />
public override bool Deactivate()
{
if (Port == null)
return false;
return Port.UnRegister() == eDeviceRegistrationUnRegistrationResponse.Success;
}