Ensure active connected printer is disabled if removed - Fixes #87154858

This commit is contained in:
John Lewin 2015-01-28 14:13:35 -08:00
parent 986b513520
commit eda577b8e9

View file

@ -230,14 +230,10 @@ namespace MatterHackers.MatterControl.PrinterControls.PrinterConnections
void RemoveConnectionLink_Click(object sender, EventArgs mouseEvent)
{
if (ActivePrinterProfile.Instance.ActivePrinter != null)
{
int connectedPrinterHash = ActivePrinterProfile.Instance.ActivePrinter.GetHashCode();
int printerOptionHash = this.printerRecord.GetHashCode();
//Disconnect printer if the printer being removed is currently connected
if (connectedPrinterHash == printerOptionHash)
if (this.printerRecord.Id == ActivePrinterProfile.Instance.ActivePrinter.Id)
{
PrinterConnectionAndCommunication.Instance.Disable();
ActivePrinterProfile.Instance.ActivePrinter = null;