func (sm *StateMachine) free() { if sm.IsConnected() { sm.Disconnect() } C.GSM_FreeStateMachine(sm.g) sm.g = nil }
// Terminates connection and free memory func (g *GSM) Terminate() (err error) { // terminate connection e := C.GSM_TerminateConnection(g.sm) if e != ERR_NONE { err = errors.New(errorString(int(e))) } // free up used memory C.GSM_FreeStateMachine(g.sm) return }