Problem: zmq timers API is not CLASS conformant

If we're going to add CLASS-like APIs we should use the proper
syntax; specifically 'destroy' instead of 'close', which is a
hangover from the 'ZeroMQ is like sockets' model we're slowly
moving away from.

Solution: change zmq_timers_close(p) to zmq_timers_destroy(&p)
This commit is contained in:
Pieter Hintjens
2015-12-21 10:56:37 +01:00
parent 627809568b
commit f8b9ca5f42
3 changed files with 8 additions and 7 deletions

View File

@@ -1185,14 +1185,15 @@ void *zmq_timers_new ()
return timers;
}
int zmq_timers_close (void *timers_)
int zmq_timers_destroy (void **timers_p_)
{
if (!timers_ || !((zmq::timers_t*)timers_)->check_tag ()) {
void *timers = *timers_p_;
if (!timers || !((zmq::timers_t *) timers)->check_tag ()) {
errno = EFAULT;
return -1;
}
delete ((zmq::timers_t*)timers_);
delete ((zmq::timers_t *) timers);
*timers_p_ = NULL;
return 0;
}