diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-10-29 16:06:11 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-10-29 16:06:11 +0100 |
commit | 09bd8f26cb37b58310ce16bf7b8b6003b4244ed5 (patch) | |
tree | 3f6b0c1e62f13e610611240ddfbe366fce98d3a3 /src/RemoteControl.h | |
parent | bf82967d4c04946ae6e0490ea28e160a856fc81b (diff) | |
download | dabmux-09bd8f26cb37b58310ce16bf7b8b6003b4244ed5.tar.gz dabmux-09bd8f26cb37b58310ce16bf7b8b6003b4244ed5.tar.bz2 dabmux-09bd8f26cb37b58310ce16bf7b8b6003b4244ed5.zip |
Some fixes for issues seen with cppcheck
Diffstat (limited to 'src/RemoteControl.h')
-rw-r--r-- | src/RemoteControl.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/RemoteControl.h b/src/RemoteControl.h index b133a8f..7fc8e04 100644 --- a/src/RemoteControl.h +++ b/src/RemoteControl.h @@ -210,7 +210,9 @@ class RemoteControllerTelnet : public BaseRemoteController { m_fault(false), m_port(port) { - restart(); + // Don't call virtual functions from the ctor + // https://isocpp.org/wiki/faq/strange-inheritance#calling-virtuals-from-ctors + internal_restart(); } @@ -221,9 +223,10 @@ class RemoteControllerTelnet : public BaseRemoteController { virtual bool fault_detected() { return m_fault; } - virtual void restart(); + virtual void restart() { internal_restart(); } private: + void internal_restart(); void restart_thread(long); void process(long); |