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

Function xlog_free

common/log/xlog.c:192–211  ·  view source on GitHub ↗

* free a log context, return 0 if success. */

Source from the content-addressed store, hash-verified

190 * free a log context, return 0 if success.
191 */
192XLOG_API void xlog_free(xlog_context* ctx)
193{
194 int i=0;
195
196 if (ctx != NULL){
197 for (i = 0; i < ctx->_count; i++)
198 {
199 if (ctx->_receivers[i]._file != NULL
200 && ctx->_receivers[i]._type == RECEIVER_TYPE_FILE)
201 {
202 fclose(ctx->_receivers[i]._file); // close the log file
203 ctx->_receivers[i]._file = NULL;
204 }
205 }
206
207 pthread_mutex_destroy(&ctx->_mutext);
208
209 free(ctx);
210 }
211}
212
213/**
214 * append a log data receiver, return 0 if success.

Callers 3

srd_log_uninitFunction · 0.85
dsv_log_uninitFunction · 0.85
sr_log_uninitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected