Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop failing if object is disposed twice. #117

Merged
merged 3 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pkgs/leak_tracker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 9.0.3

* Stop failing if an object is disposed twice.

# 9.0.2

* Make sure phase bondaries are handled correctly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ class ObjectRecord {
int? _disposalGcCount;

void setDisposed(int gcTime, DateTime time) {
if (_disposalGcCount != null) throw 'The object $code was disposed twice.';
// TODO(polina-c): handle double disposal in a better way
// https://github.com/dart-lang/leak_tracker/issues/118
// Noop if object is already disposed.
if (_disposalGcCount != null) return;
if (_gcedGcCount != null) {
throw 'The object $code should not be disposed after being GCed.';
}
Expand Down
2 changes: 1 addition & 1 deletion pkgs/leak_tracker/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: leak_tracker
version: 9.0.2
version: 9.0.3
description: A framework for memory leak tracking for Dart and Flutter applications.
repository: https://github.com/dart-lang/leak_tracker/tree/main/pkgs/leak_tracker

Expand Down