From e195c025c303e361d0cc5a207f9c9443fb8deced Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Mon, 18 Nov 2013 01:21:16 +0100 Subject: Check library initialization before handling decoders --- srd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'srd.c') diff --git a/srd.c b/srd.c index 07d7952..1c7f6f9 100644 --- a/srd.c +++ b/srd.c @@ -263,4 +263,14 @@ SRD_PRIV int srd_decoder_searchpath_add(const char *path) return SRD_OK; } +/* @private */ +SRD_PRIV gboolean srd_check_init(void) +{ + if (max_session_id < 0) { + srd_err("Library is not initialized."); + return FALSE; + } else + return TRUE; +} + /** @} */ -- cgit v1.2.3-70-g09d2