BelledonneCommunications / flexisip

Linphone.org mirror for flexisip (git://git.linphone.org/flexisip.git)
http://flexisip.org
GNU Affero General Public License v3.0
144 stars 69 forks source link

lAgent seems to be going out of scope right after instantiation #46

Open boarden opened 5 years ago

boarden commented 5 years ago

https://github.com/BelledonneCommunications/flexisip/blob/1138d4a4ba5c30109c12b2bbc542d72eecc975e3/src/main.cc#L899

I think, this causes SNMP support to fail. Possible fix:

shared_ptr<SnmpAgent> lAgent;

if (startProxy){
    a->start(transportsArg.getValue());
    setOpenSSLThreadSafe();
#ifdef ENABLE_SNMP
    bool snmpEnabled = cfg->getGlobal()->get<ConfigBoolean>("enable-snmp")->read();
    if (snmpEnabled) {
         lAgent = make_shared<SnmpAgent>(*a, *cfg, oset);
    }
#endif