Shutdown Tidyup

McWilliams, Gary gmcwilliams____cccnetsys.com
Wed Nov 22 14:24:14 CET 2000


I am using agent++ / snmp++ on NT.

Using Boundschecker, we get notification of several 'leaks'. Mostly these
are related to static pointers that get new'ed but never deleted. Nothing
inherently wrong with that, however, having to go through these each time in
Boundschecker (to ensure they are not *real* leaks) is becoming a bit of a
pain.

Can I make some suggestions?


1. LogEntry
The static 'value' member pointer gets newed with 256 bytes on first use.
These never get deleted. Why not just make the value member a static array
of size 256?. The ctor for the LogEntry class can memset this to zero before
use if required.
Alternatively, just let each LogEntry object new it's own 256 chars (i.e.
make pointer non static) - the dtor can then delete this. This seems like a
better solution for a threaded environment, where multiple threads may be
logging at the same time.

2. MibIIsnmpCounters
Likewise make counter_snmp a static array, rather than a static pointer to
an array

3. ThreadManager
The dtor, under NT, does not Delete the Critical Sections created in the
ctor.






--
Gary McWilliams 
Principal Engineer 
CCC Network Systems Ltd, R&D facility Belfast 
http://www.cccnetsys.com





More information about the AGENTPP mailing list