[AGENT++] Question about ownership

Jochen Katz katz at agentpp.com
Thu Feb 17 22:08:29 CET 2011


Hi,

> I'm I right: the pointers passed to methods
>   RequestList::set_v3mp(v3MP* mp);
>   RequestList::set_vacm(Vacm* v);
> 
> do not pass the ownership over v3MP* and Vacm*, and they are
> considered to exist during RequestList object lifetime?

yes. The expected cleanup is:

        delete reqList;
        delete mib;
#ifdef _SNMPv3
        delete vacm;
        delete v3mp;
#endif

> I'm asking becouse in the examples I see v3MP* and Vacm* created via
> new operator,
> but no delete operator complements them, and in the sources I didn't
> find them (class members that hold the pointers) to be deleted.

This was already changed in the repository and will be in the next release.

Regards,
  Jochen



More information about the AGENTPP mailing list