| 145 | } |
| 146 | |
| 147 | static void lang_cleanup(LangProj *lp, cbm_store_t *store) { |
| 148 | if (store) { |
| 149 | cbm_store_close(store); |
| 150 | } |
| 151 | if (lp->srv) { |
| 152 | cbm_mcp_server_free(lp->srv); |
| 153 | lp->srv = NULL; |
| 154 | } |
| 155 | free(lp->project); |
| 156 | lp->project = NULL; |
| 157 | th_rmtree(lp->tmpdir); |
| 158 | unlink(lp->dbpath); |
| 159 | char wal[600]; |
| 160 | char shm[600]; |
| 161 | snprintf(wal, sizeof(wal), "%s-wal", lp->dbpath); |
| 162 | unlink(wal); |
| 163 | snprintf(shm, sizeof(shm), "%s-shm", lp->dbpath); |
| 164 | unlink(shm); |
| 165 | } |
| 166 | |
| 167 | /* Count nodes of `label` with >=1 outbound edge. Returns -1 on query error. */ |
| 168 | static int label_with_outbound(cbm_store_t *store, const char *project, const char *label) { |
no test coverage detected