mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 04:39:07 -04:00
refactor!: use Finalizer
to automatically free allocated memory for objects
BREAKING CHANGE: signature change for remote and repository callbacks during repository clone operation.
This commit is contained in:
parent
94c40f9a94
commit
b589097c8c
73 changed files with 1073 additions and 1618 deletions
|
@ -19,7 +19,6 @@ void main() {
|
|||
});
|
||||
|
||||
tearDown(() {
|
||||
tree.free();
|
||||
repo.free();
|
||||
tmpDir.deleteSync(recursive: true);
|
||||
});
|
||||
|
@ -65,7 +64,6 @@ void main() {
|
|||
final entry = tree['dir/dir_file.txt'];
|
||||
expect(entry.oid.sha, 'e69de29bb2d1d6434b8b29ae775ad8c2e48c5391');
|
||||
expect(entry.toString(), contains('TreeEntry{'));
|
||||
entry.free();
|
||||
});
|
||||
|
||||
test('throws when nothing found for provided path', () {
|
||||
|
@ -92,9 +90,17 @@ void main() {
|
|||
expect(entry.name, 'filename');
|
||||
expect(entry.filemode, GitFilemode.blob);
|
||||
expect(entry.oid, fileOid);
|
||||
});
|
||||
|
||||
builder.free();
|
||||
newTree.free();
|
||||
test('manually releases allocated memory', () {
|
||||
final tree = Tree.lookup(repo: repo, oid: repo['a8ae3dd']);
|
||||
expect(() => tree.free(), returnsNormally);
|
||||
});
|
||||
|
||||
test(
|
||||
'manually releases allocated memory for tree entry '
|
||||
'looked up by path', () {
|
||||
expect(() => tree['dir/dir_file.txt'].free(), returnsNormally);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue