release a rig handle and free associated memory Releases a rig struct which port has eventualy been closed already with rig_close().
Definition at line 689 of file rig.c. References caps, rig_state::comm_state, rig_caps::rig_cleanup, rig_close(), rig_debug(), RIG_DEBUG_VERBOSE, RIG_EINVAL, RIG_OK, and state. { rig_debug(RIG_DEBUG_VERBOSE,"rig:rig_cleanup called \n"); if (!rig || !rig->caps) return -RIG_EINVAL; /* * check if they forgot to close the rig */ if (rig->state.comm_state) rig_close(rig); /* * basically free up the priv struct */ if (rig->caps->rig_cleanup) rig->caps->rig_cleanup(rig); free(rig); return RIG_OK; }
|