Fixed SimulationView spamming exceptions in some situations:
authorDaniel Kirschten <daniel.kirschten@gmx.de>
Thu, 3 Oct 2019 11:23:20 +0000 (13:23 +0200)
committerDaniel Kirschten <daniel.kirschten@gmx.de>
Thu, 3 Oct 2019 11:23:20 +0000 (13:23 +0200)
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

plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/ActiveInstructionPreviewContentProvider.java
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java

index 97fbd19..7078f9a 100644 (file)
@@ -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);
        }
 }
index 4d118a9..80bb7fb 100644 (file)
@@ -296,6 +296,7 @@ public class SimulationView extends ViewPart
        public void dispose()
        {
                deregisterMachineDependentListeners();
+               contentProvider.setMachine(null);
                DebugUITools.getDebugContextManager().removeDebugContextListener(debugContextListener);
                super.dispose();
        }