From: Daniel Kirschten Date: Thu, 3 Oct 2019 11:23:20 +0000 (+0200) Subject: Fixed SimulationView spamming exceptions in some situations: X-Git-Url: https://mograsim.net/gitweb/?a=commitdiff_plain;h=1cb397369db5176ac9f12725c65321bcf92a70ee;hp=b8840982674bd3ef4b42913c91abe8badc9a8bd8;p=Mograsim.git 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 --- 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(); }