summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-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.