Skip to content

Commit

Permalink
DisconnectAllComponents() upon Circuit destruction
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusTomlinson committed Mar 26, 2024
1 parent 5e86051 commit 2033839
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/dspatch/Circuit.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ inline Circuit::Circuit() = default;
inline Circuit::~Circuit()
{
StopAutoTick();
DisconnectAllComponents();
}

inline bool Circuit::AddComponent( const Component::SPtr& component )
Expand Down Expand Up @@ -500,6 +501,8 @@ inline void Circuit::RemoveAllComponents()
{
PauseAutoTick();

DisconnectAllComponents();

_components.clear();
_componentsParallel.clear();

Expand Down Expand Up @@ -559,7 +562,6 @@ inline bool Circuit::DisconnectComponent( const Component::SPtr& component )
return true;
}

// cppcheck-suppress unusedFunction
inline void Circuit::DisconnectAllComponents()
{
PauseAutoTick();
Expand Down

0 comments on commit 2033839

Please sign in to comment.