Logo Search packages:      
Sourcecode: sofia-sip version File versions  Download package

SOFIAPUBFUN void su_root_destroy ( su_root_t self )

Destroy a root object.

Stop and free an instance of su_root_t

selfpointer to a root object.

Definition at line 501 of file su_root.c.

References SU_DEBUG_1, su_free(), su_root_destroy(), su_task_deferrable(), su_task_timers(), and su_timer_reset_all().

Referenced by su_base_port_wait(), and su_root_destroy().

  su_port_t *port;
  int unregistered, reset;

  if (!self)


  self->sur_deiniting = 1;

  if (self->sur_deinit) {
    su_root_deinit_f deinit = self->sur_deinit;
    su_root_magic_t *magic = self->sur_magic;
    self->sur_deinit = NULL;
    deinit(self, magic);

  port = self->sur_port; assert(port);

  unregistered = su_port_unregister_all(port, self);
  reset = su_timer_reset_all(su_task_timers(self->sur_task), self->sur_task);

  if (su_task_deferrable(self->sur_task))
    reset += su_timer_reset_all(su_task_deferrable(self->sur_task),

  if (unregistered || reset)
    SU_DEBUG_1(("su_root_destroy: "
            "%u registered waits, %u timers\n",
            unregistered, reset));

  SU_TASK_ZAP(self->sur_parent, su_root_destroy);

  su_free(su_port_home(port), self);

  su_port_decref(port, "su_root_destroy");

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index