Skip to content

Commit

Permalink
Dispose current circuit before starting to make next one as it can cr…
Browse files Browse the repository at this point in the history
…eate issues where they kinda both exist at the same time
  • Loading branch information
TheAIBot committed Aug 13, 2021
1 parent 7b12517 commit da18374
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ChiselDebuggerRazor/Pages/CircuitViewer.razor
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -109,7 +111,6 @@ else if (ThrownException is Exception)

ModulePosition = new Positioned<ChiselDebug.GraphFIR.Module>(Point.Zero, graph.MainModule);
RootModLayout = new CircuitLayout();
DebugCtrl?.Dispose();
DebugCtrl = new DebugController(graph);
DebugCtrl.OnCircuitSizeChanged += CircuitSizeChanged;

Expand Down

0 comments on commit da18374

Please sign in to comment.