diff --git a/ChiselDebuggerRazor/Pages/CircuitViewer.razor b/ChiselDebuggerRazor/Pages/CircuitViewer.razor index 480d1b4e..0ce4b776 100644 --- a/ChiselDebuggerRazor/Pages/CircuitViewer.razor +++ b/ChiselDebuggerRazor/Pages/CircuitViewer.razor @@ -80,6 +80,8 @@ else if (ThrownException is Exception) { DragEventID = UniqueID.UniqueHTMLID(); CircuitContainerID = UniqueID.UniqueHTMLID(); + DebugCtrl?.Dispose(); + DebugCtrl = null; using var loFir = Files.GetLoFirrtlStream(); using var hiFir = Files.GetHiFirrtlStream(); @@ -109,7 +111,6 @@ else if (ThrownException is Exception) ModulePosition = new Positioned(Point.Zero, graph.MainModule); RootModLayout = new CircuitLayout(); - DebugCtrl?.Dispose(); DebugCtrl = new DebugController(graph); DebugCtrl.OnCircuitSizeChanged += CircuitSizeChanged;