Skip to content

Commit 2033839

Browse files
DisconnectAllComponents() upon Circuit destruction
1 parent 5e86051 commit 2033839

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/dspatch/Circuit.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ inline Circuit::Circuit() = default;
446446
inline Circuit::~Circuit()
447447
{
448448
StopAutoTick();
449+
DisconnectAllComponents();
449450
}
450451

451452
inline bool Circuit::AddComponent( const Component::SPtr& component )
@@ -500,6 +501,8 @@ inline void Circuit::RemoveAllComponents()
500501
{
501502
PauseAutoTick();
502503

504+
DisconnectAllComponents();
505+
503506
_components.clear();
504507
_componentsParallel.clear();
505508

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

562-
// cppcheck-suppress unusedFunction
563565
inline void Circuit::DisconnectAllComponents()
564566
{
565567
PauseAutoTick();

0 commit comments

Comments
 (0)