mirror of
https://github.com/zeromq/libzmq.git
synced 2025-11-04 20:31:03 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user