void BlogFree(BlogRef *const blogptr) { BlogRef blog = *blogptr; if(!blog) return; blog->repo = NULL; FREE(&blog->dir); FREE(&blog->cacheDir); TemplateFree(&blog->header); TemplateFree(&blog->footer); TemplateFree(&blog->entry_start); TemplateFree(&blog->entry_end); TemplateFree(&blog->preview); TemplateFree(&blog->empty); TemplateFree(&blog->compose); TemplateFree(&blog->upload); TemplateFree(&blog->login); TemplateFree(&blog->notfound); TemplateFree(&blog->noresults); async_mutex_destroy(blog->pending_mutex); async_cond_destroy(blog->pending_cond); assert_zeroed(blog, 1); FREE(blogptr); blog = NULL; }
void EFSSyncFree(EFSSyncRef *const syncptr) { assert(syncptr); EFSSyncRef sync = *syncptr; if(!sync) return; sync->stop = true; // TODO: Join db_thread sync->session = NULL; FREE(&sync->syncID); async_mutex_destroy(sync->mutex); async_cond_destroy(sync->cond); sync->cur = NULL; // TODO: Clear queues assert_zeroed(sync, 1); FREE(syncptr); sync = NULL; }
void SLNPullFree(SLNPullRef *const pullptr) { SLNPullRef pull = *pullptr; if(!pull) return; SLNPullStop(pull); pull->pullID = 0; SLNSessionRelease(&pull->session); FREE(&pull->host); FREE(&pull->cookie); // FREE(&pull->query); async_mutex_destroy(pull->connlock); async_mutex_destroy(pull->mutex); async_cond_destroy(pull->cond); pull->stop = false; assert_zeroed(pull, 1); FREE(pullptr); pull = NULL; }