MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / sp_cleanup

Function sp_cleanup

tests/test_spawns.c:228–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226}
227
228static void sp_cleanup(sp_proj_t *p) {
229 if (p->store) {
230 cbm_store_close(p->store);
231 }
232 if (p->srv) {
233 cbm_mcp_server_free(p->srv);
234 }
235 if (p->dbpath[0]) {
236 char side[1100];
237 unlink(p->dbpath);
238 snprintf(side, sizeof(side), "%s-wal", p->dbpath);
239 unlink(side);
240 snprintf(side, sizeof(side), "%s-shm", p->dbpath);
241 unlink(side);
242 }
243 free(p->project);
244 if (p->tmpdir[0]) {
245 th_rmtree(p->tmpdir);
246 }
247 memset(p, 0, sizeof(*p));
248}
249
250static int sp_count(sp_proj_t *p, const char *sql, const char *a, const char *b) {
251 sqlite3 *db = cbm_store_get_db(p->store);

Callers 1

test_spawns.cFile · 0.85

Calls 3

cbm_store_closeFunction · 0.85
cbm_mcp_server_freeFunction · 0.85
th_rmtreeFunction · 0.85

Tested by

no test coverage detected