summaryrefslogtreecommitdiffstats
path: root/src/RemoteControl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/RemoteControl.h')
-rw-r--r--src/RemoteControl.h7
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);