diff options
| author | Vicent Marti <tanoku@gmail.com> | 2010-08-12 23:40:54 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2010-08-12 23:40:54 +0200 |
| commit | 9c9f4fc11c85d621dc5fdcf46bbcb5b5da9ed73f (patch) | |
| tree | b74a41b8df31f0fc88809d1d479742b3f5b3c192 /src/git | |
| parent | f2408cc2efc1752bb34011a655f6acdab4e9e602 (diff) | |
| download | libgit2-9c9f4fc11c85d621dc5fdcf46bbcb5b5da9ed73f.tar.gz | |
Add support for manually freeing repo objects
A new method 'git_repository_object_free' allows to manually force the
freeing of a repository object, even though they are still automatically
managed by the repository and don't need to be freed by the user.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git')
| -rw-r--r-- | src/git/repository.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/git/repository.h b/src/git/repository.h index 3b6981d50..001e4e9fb 100644 --- a/src/git/repository.h +++ b/src/git/repository.h @@ -49,6 +49,21 @@ GIT_EXTERN(git_repository *) git_repository_alloc(git_odb *odb); */ GIT_EXTERN(git_repository_object *) git_repository_lookup(git_repository *repo, const git_oid *id, git_otype type); + +/** + * Free a reference to one of the objects in the repostory. + * + * Repository objects are managed automatically by the library, + * but this method can be used to force freeing one of the + * objects. + * + * Careful: freeing objects in the middle of a repository + * traversal will most likely cause errors. + * + * @param object the object to free + */ +GIT_EXTERN(void) git_repository_object_free(git_repository_object *object); + /** * Free a previously allocated repository * @param repo repository handle to close. If NULL nothing occurs. |
