diff options
author | Carlos Martin Nieto <cmn@elego.de> | 2012-06-28 12:05:49 +0200 |
---|---|---|
committer | Carlos Martin Nieto <cmn@elego.de> | 2012-06-28 12:10:33 +0200 |
commit | 1d8943c640bad4425b8578aae6f680fa8e513bc7 (patch) | |
tree | 1449d930980d07f5c7a1c12d1f9b0c63b41ba4ab /src/indexer.c | |
parent | 1de44c24936ecf39915913ddf26f68f78c7963d3 (diff) | |
download | libgit2-1d8943c640bad4425b8578aae6f680fa8e513bc7.tar.gz |
mwindow: allow memory-window files to deregister
Once a file is registered, there is no way to deregister it, even
after the structure that contains it is no longer needed and has been
freed. This may be the source of #624.
Allow and use the deregister function to remove our file from the
global list.
Diffstat (limited to 'src/indexer.c')
-rw-r--r-- | src/indexer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/indexer.c b/src/indexer.c index b4312e15a..1f0ca82a2 100644 --- a/src/indexer.c +++ b/src/indexer.c @@ -773,6 +773,7 @@ int git_indexer_write(git_indexer *idx) cleanup: git_mwindow_free_all(&idx->pack->mwf); + git_mwindow_file_deregister(&idx->pack->mwf); if (error < 0) git_filebuf_cleanup(&idx->file); git_buf_free(&filename); @@ -886,6 +887,7 @@ void git_indexer_free(git_indexer *idx) return; p_close(idx->pack->mwf.fd); + git_mwindow_file_deregister(&idx->pack->mwf); git_vector_foreach(&idx->objects, i, e) git__free(e); git_vector_free(&idx->objects); |