mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
refactor: use libgit free() functions instead of calloc()
This commit is contained in:
parent
4f851bc2e5
commit
2477b4efd8
14 changed files with 30 additions and 21 deletions
|
@ -17,7 +17,7 @@ class Config {
|
|||
/// [path] should point to single on-disk file; it's expected to be a native
|
||||
/// Git config file following the default Git config syntax (see man git-config).
|
||||
///
|
||||
/// [Config] object should be closed with [close] function to release allocated memory.
|
||||
/// [Config] object should be closed with [free] function to release allocated memory.
|
||||
Config.open({this.path}) {
|
||||
libgit2.git_libgit2_init();
|
||||
|
||||
|
@ -145,8 +145,8 @@ class Config {
|
|||
}
|
||||
|
||||
/// Releases memory allocated for config object.
|
||||
void close() {
|
||||
calloc.free(_configPointer);
|
||||
void free() {
|
||||
bindings.free(_configPointer);
|
||||
libgit2.git_libgit2_shutdown();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue