diff --git a/src/sd_bot.cpp b/src/sd_bot.cpp index cd15849..410e9b9 100644 --- a/src/sd_bot.cpp +++ b/src/sd_bot.cpp @@ -204,7 +204,7 @@ SDBot::SDBot( Contact3Registry& cr, RegistryMessageModelI& rmm, ConfigModelI& conf -) : _cr(cr), _rmm(rmm), _conf(conf) { +) : _cr(cr), _rmm(rmm), _rmm_sr(_rmm.newSubRef(this)), _conf(conf) { _rng.seed(std::random_device{}()); _rng.discard(3137); @@ -252,7 +252,7 @@ SDBot::SDBot( _conf.set("SDBot", "cfg_scale", 6.5); } - _rmm.subscribe(this, RegistryMessageModel_Event::message_construct); + _rmm_sr.subscribe(RegistryMessageModel_Event::message_construct); } SDBot::~SDBot(void) { diff --git a/src/sd_bot.hpp b/src/sd_bot.hpp index f80eda4..d01d390 100644 --- a/src/sd_bot.hpp +++ b/src/sd_bot.hpp @@ -21,6 +21,7 @@ struct ConfigModelI; class SDBot : public RegistryMessageModelEventI { Contact3Registry& _cr; RegistryMessageModelI& _rmm; + RegistryMessageModelI::SubscriptionReference _rmm_sr; ConfigModelI& _conf; //TransferManager& _tm;