You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
minigraf_close does not release an open cursor or fact log: reopening the path fails #10
After minigraf_close(db), a MiniGrafCursor or MiniGrafFactLog from that handle that hasn't been freed still holds a core Snapshot, which keeps the storage (the in-process registration and the file lock) alive. minigraf_open of the same path returns NULL until the cursor or log is freed.
MiniGrafDb*db=minigraf_open(p);
minigraf_string_free(minigraf_execute(db, "(transact [[:a :n 1]])"));
minigraf_checkpoint(db);
MiniGrafCursor*c=minigraf_query(db, "(query [:find ?e :where [?e :n _]])"); /* or minigraf_fact_log */minigraf_close(db);
minigraf_open(p); /* NULL: still open in this process */
Prepared queries (#181) avoid this: minigraf_close empties every MiniGrafPrepared made from the handle. Cursors and fact logs could do the same (a weak list on MiniGrafDb; later next_batch returns NULL with no error), or the header could document that they must be freed before minigraf_close when the path will be reopened.
Activity