From 1cb397369db5176ac9f12725c65321bcf92a70ee Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Thu, 3 Oct 2019 13:23:20 +0200 Subject: [PATCH] Fixed SimulationView spamming exceptions in some situations: When closing the SimulationView while it is displaying a machine, the content provider still had its ActiveMicroInstructionChangedListener registered in this machine, causing updateElement to be called when the machine does a cycle, causing the log to be spammed with exceptions --- .../tables/mi/ActiveInstructionPreviewContentProvider.java | 2 +- .../src/net/mograsim/plugin/views/SimulationView.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/ActiveInstructionPreviewContentProvider.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/ActiveInstructionPreviewContentProvider.java index 97fbd191..7078f9a1 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/ActiveInstructionPreviewContentProvider.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/ActiveInstructionPreviewContentProvider.java @@ -56,7 +56,7 @@ public class ActiveInstructionPreviewContentProvider implements InstructionTable @Override public void updateElement(int index) { - if (activeRow != null) + if (activeRow != null && !viewer.getControl().isDisposed()) viewer.replace(activeRow, index); } } diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java index 4d118a9f..80bb7fb4 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java @@ -296,6 +296,7 @@ public class SimulationView extends ViewPart public void dispose() { deregisterMachineDependentListeners(); + contentProvider.setMachine(null); DebugUITools.getDebugContextManager().removeDebugContextListener(debugContextListener); super.dispose(); } -- 2.17.1