On Mon, 12 Sep 2005 15:25:26 -0700 Wes wrote:
WH> >>>>> On Sat, 10 Sep 2005 17:32:12 +0200, Magnus Fromreide
WH> >>>>> <[EMAIL PROTECTED]> said:
WH>
WH> Magnus> snmp_sess_add_ex(netsnmp_session* sess, netsnmp_transport*
WH> Magnus> trans, ...)
WH>
WH> I'd respond to that comment, but it's been a while since I looked at
WH> that portion of the code...
WH>
WH> Magnus> snmp_register_callback(int, int, new_callback, void* arg)
WH>
WH> Magnus> The arg parameter is freed when clear_callback is called but
WH> Magnus> not under any other circumstances. Who owns that pointer? The
WH> Magnus> implication of this one is the infamous
WH>
WH> Callbacks, however, are more my bag (baby). The arg is a magic
WH> pointer supplied by the caller so the library can *never* free it
WH> since it doesn't know how (IE, it doesn't know what it is).
Ummm...
callback.c Revision 5.1
Wed Jul 2 20:20:56 2003 UTC (2 years, 2 months ago) by hardaker
Patch #724925 from Peter Warasin to free lots of memory for a really clean
shutdown
This patch creates the clear_callback() function, which basically loops
through the callback lists, freeing the client args.
WH> What should be done, if you want proper memory controlled programming,
WH> is that everything that registers a callback with an arg would have to
WH> save the returned magic number and use that later to unregister it and
WH> then free the pointer.
Or add a function pointer to a release routine that can be called during
shutdown.
--
NOTE: messages sent directly to me, instead of the lists, will be deleted
unless they are requests for paid consulting services.
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders