minor fixes

This commit is contained in:
Thibault Deckers 2023-12-21 16:37:41 +01:00
parent c95b381fad
commit 929d7c25fd
4 changed files with 7 additions and 7 deletions

View file

@ -219,9 +219,7 @@ class _PackageLicensePageState extends State<_PackageLicensePage> {
return true; return true;
}()); }());
for (final LicenseEntry license in widget.licenseEntries) { for (final LicenseEntry license in widget.licenseEntries) {
if (!mounted) { if (!mounted) return;
return;
}
assert(() { assert(() {
Timeline.timeSync('_initLicenses()', () {}, flow: Flow.step(debugFlowId)); Timeline.timeSync('_initLicenses()', () {}, flow: Flow.step(debugFlowId));
return true; return true;
@ -231,9 +229,7 @@ class _PackageLicensePageState extends State<_PackageLicensePage> {
Priority.animation, Priority.animation,
debugLabel: 'License', debugLabel: 'License',
); );
if (!mounted) { if (!mounted) return;
return;
}
setState(() { setState(() {
_licenses.add(const Padding( _licenses.add(const Padding(
padding: EdgeInsets.all(18.0), padding: EdgeInsets.all(18.0),

View file

@ -66,6 +66,9 @@ class _DebugGeneralSectionState extends State<DebugGeneralSection> with Automati
ElevatedButton( ElevatedButton(
onPressed: () => LeakTracking.collectLeaks().then((leaks) { onPressed: () => LeakTracking.collectLeaks().then((leaks) {
leaks.byType.forEach((type, reports) { leaks.byType.forEach((type, reports) {
// ignore `notGCed` and `gcedLate` for now
if (type != LeakType.notDisposed) return;
debugPrint('* leak type=$type'); debugPrint('* leak type=$type');
groupBy(reports, (report) => report.type).forEach((reportType, typedReports) { groupBy(reports, (report) => report.type).forEach((reportType, typedReports) {
debugPrint(' * report type=$reportType'); debugPrint(' * report type=$reportType');

View file

@ -26,7 +26,7 @@ mixin EntryViewControllerMixin<T extends StatefulWidget> on State<T> {
ValueNotifier<AvesEntry?> get entryNotifier; ValueNotifier<AvesEntry?> get entryNotifier;
Future<void> initEntryControllers(AvesEntry? entry) async { Future<void> initEntryControllers(AvesEntry? entry) async {
if (entry == null) return; if (!mounted || entry == null) return;
if (entry.isVideo) { if (entry.isVideo) {
await _initVideoController(entry); await _initVideoController(entry);

View file

@ -79,6 +79,7 @@ class _VideoCoverState extends State<VideoCover> {
@override @override
void dispose() { void dispose() {
_unregisterWidget(widget); _unregisterWidget(widget);
_dismissedCoverMagnifierController?.dispose();
_videoCoverInfoNotifier.dispose(); _videoCoverInfoNotifier.dispose();
super.dispose(); super.dispose();
} }