MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / srd_session_destroy

Function srd_session_destroy

libsigrokdecode4DSL/session.c:344–362  ·  view source on GitHub ↗

* Destroy a decoding session. * * All decoder instances and output callbacks are properly released. * * @param sess The session to be destroyed. Must not be NULL. * * @return SRD_OK upon success, a (negative) error code otherwise. * * @since 0.3.0 */

Source from the content-addressed store, hash-verified

342 * @since 0.3.0
343 */
344SRD_API int srd_session_destroy(struct srd_session *sess)
345{
346 int session_id;
347
348 if (!sess)
349 return SRD_ERR_ARG;
350
351 session_id = sess->session_id;
352 if (sess->di_list)
353 srd_inst_free_all(sess);
354 if (sess->callbacks)
355 g_slist_free_full(sess->callbacks, g_free);
356 sessions = g_slist_remove(sessions, sess);
357 g_free(sess);
358
359 srd_info("Destroyed session %d.", session_id);
360
361 return SRD_OK;
362}
363
364/**
365 * Register/add a decoder output callback function.

Callers 2

srd_session_destroy_cbFunction · 0.85
execute_decode_stackMethod · 0.85

Calls 1

srd_inst_free_allFunction · 0.85

Tested by

no test coverage detected