diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-02-28 16:51:17 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-03-03 20:23:52 +0200 |
commit | 48c27f86bbe9678c7e01a90a2cec7a30327b0e90 (patch) | |
tree | 0156ea823de82477792ad4778378200eee28aee3 /src/blob.c | |
parent | 86d7e1ca6f54161a9e4d1ebe7a2f8e4802dc9639 (diff) | |
download | libgit2-48c27f86bbe9678c7e01a90a2cec7a30327b0e90.tar.gz |
Implement reference counting for git_objects
All `git_object` instances looked up from the repository are reference
counted. User is expected to use the new `git_object_close` when an
object is no longer needed to force freeing it.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/blob.c')
-rw-r--r-- | src/blob.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/blob.c b/src/blob.c index c5a7143f0..f271cc7f6 100644 --- a/src/blob.c +++ b/src/blob.c @@ -129,6 +129,10 @@ int git_blob_writefile(git_oid *written_id, git_repository *repo, const char *pa return error; git_oid_cpy(written_id, git_object_id((git_object *)blob)); + + /* FIXME: maybe we don't want to free this already? + * the user may want to access it again */ + git_object_close((git_object *)blob); return GIT_SUCCESS; } |