I'm working on SipRefreshManager, which maintains a UtlHashBag of
RefreshDialogState objects.  SipRefreshManager sets timers, and the
timers' userData fields are pointers to the RefreshDialogState object
that the timer concerns.  The problem is:  When a timer fires, how do I
check that the RefreshDialogState object that the timer points to has
not been removed from the UtlHashBag and deleted?

The current code uses this test:  utlHashBag.findReference(userData)
However, that doesn't work reliably, because UtlHashBag::findReference
requires that the searched-for pointer value point to a
validly-allocated object (because it will call the pointer's hash()
method).  There are also problems with objects being deleted and then
reallocated in the same location.

The only method I can see is to have the timers carry an identifier of
the RefreshDialogState object that is not allocated as part of the
R.D.S., and search the UtlHashBag using that identifier.

Thoughts?

Dale


_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev

Reply via email to