Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-11-26 07:59:21 +0400
committerVicent Marti <tanoku@gmail.com>2011-11-26 11:48:00 +0400
commit45e79e37012ffec58c754000c23077ecac2da753 (patch)
tree809092609a4ca641ada8990c9008c7fb96c9cc07 /examples/general.c
parent9462c471435b4de74848408bebe41d770dc49a50 (diff)
Rename all `_close` methods
There's no difference between `_free` and `_close` semantics: keep everything with the same name to avoid confusions.
Diffstat (limited to 'examples/general.c')
-rw-r--r--examples/general.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/general.c b/examples/general.c
index 8b58fa6ff..c67ff6f64 100644
--- a/examples/general.c
+++ b/examples/general.c
@@ -107,7 +107,7 @@ int main (int argc, char** argv)
// For proper memory management, close the object when you are done with it or it will leak
// memory.
- git_odb_object_close(obj);
+ git_odb_object_free(obj);
// #### Raw Object Writing
@@ -167,12 +167,12 @@ int main (int argc, char** argv)
git_commit_parent(&parent, commit, p);
git_oid_fmt(out, git_commit_id(parent));
printf("Parent: %s\n", out);
- git_commit_close(parent);
+ git_commit_free(parent);
}
// Don't forget to close the object to prevent memory leaks. You will have to do this for
// all the objects you open and parse.
- git_commit_close(commit);
+ git_commit_free(commit);
// #### Writing Commits
//
@@ -243,7 +243,7 @@ int main (int argc, char** argv)
tmessage = git_tag_message(tag); // "tag message\n"
printf("Tag Message: %s\n", tmessage);
- git_commit_close(commit);
+ git_commit_free(commit);
// #### Tree Parsing
// [Tree parsing][tp] is a bit different than the other objects, in that we have a subtype which is the
@@ -276,7 +276,7 @@ int main (int argc, char** argv)
git_tree_entry_2object(&objt, repo, entry); // blob
// Remember to close the looked-up object once you are done using it
- git_object_close(objt);
+ git_object_free(objt);
// #### Blob Parsing
//
@@ -340,7 +340,7 @@ int main (int argc, char** argv)
cmsg = git_commit_message(wcommit);
cauth = git_commit_author(wcommit);
printf("%s (%s)\n", cmsg, cauth->email);
- git_commit_close(wcommit);
+ git_commit_free(wcommit);
}
// Like the other objects, be sure to free the revwalker when you're done to prevent memory leaks.