Apparently this was able to lead to "widget disposed" exceptions, and
for some reason the old canvas sill stays at it's place, causing two
canvases side by side.
double offX;
double offY;
double zoom;
+ if (exec != null)
+ exec.stopLiveExecution();
+ if (machine != null)
+ {
+ machine.getMicroInstructionMemory().deregisterCellModifiedListener(currentRegisteredCellListener);
+ machine.getClock().deregisterObserver(currentClockObserver);
+ }
if (canvas != null)
{
offX = canvas.getOffX();
offY = 0;
zoom = -1;
}
- if (exec != null)
- exec.stopLiveExecution();
-
- if (machine != null)
- {
- machine.getMicroInstructionMemory().deregisterCellModifiedListener(currentRegisteredCellListener);
- machine.getClock().deregisterObserver(currentClockObserver);
- }
Optional<Machine> machineOptional;
if (context != null && (machineOptional = context.getActiveMachine()).isPresent())