TF-3924 Thread Detail Memory leak resolve
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
// Copyright 2019 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
/// This file shims dart:ui in web-only scenarios, getting rid of the need to
|
||||
/// suppress analyzer warnings.
|
||||
|
||||
// TODO(): flutter/flutter#55000 Remove this file once web-only dart:ui APIs
|
||||
// are exposed from a dedicated place.
|
||||
export 'dart_ui_fake.dart' if (dart.library.html) 'dart_ui_real.dart';
|
||||
@@ -1,21 +0,0 @@
|
||||
// Copyright 2019 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Fake interface for the logic that this package needs from (web-only) dart:ui.
|
||||
// This is conditionally exported so the analyzer sees these methods as available.
|
||||
|
||||
/// Shim for web_ui engine.PlatformViewRegistry
|
||||
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/ui.dart#L62
|
||||
// ignore: camel_case_types
|
||||
class platformViewRegistry {
|
||||
/// Shim for registerViewFactory
|
||||
/// https://github.com/flutter/engine/blob/master/lib/web_ui/lib/ui.dart#L72
|
||||
static void registerViewFactory(
|
||||
String viewTypeId, dynamic Function(int viewId) viewFactory) {}
|
||||
}
|
||||
|
||||
/// Signature of callbacks that have no arguments and return no data.
|
||||
typedef VoidCallback = void Function();
|
||||
|
||||
dynamic get window => null;
|
||||
@@ -1,5 +0,0 @@
|
||||
// Copyright 2019 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
export 'dart:ui_web';
|
||||
@@ -4,7 +4,6 @@ import 'dart:math' as math;
|
||||
|
||||
import 'package:core/presentation/constants/constants_ui.dart';
|
||||
import 'package:core/presentation/extensions/color_extension.dart';
|
||||
import 'package:core/presentation/utils/shims/dart_ui.dart' as ui;
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:core/utils/html/html_interaction.dart';
|
||||
import 'package:core/utils/html/html_template.dart';
|
||||
@@ -370,22 +369,7 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
|
||||
_createdViewId = _getRandString(10);
|
||||
_htmlData = _generateHtmlDocument(widget.contentHtml);
|
||||
|
||||
final iframe = html.IFrameElement()
|
||||
..width = _actualWidth.toString()
|
||||
..height = _actualHeight.toString()
|
||||
..srcdoc = _htmlData ?? ''
|
||||
..style.border = 'none'
|
||||
..style.overflow = 'hidden'
|
||||
..style.width = '100%'
|
||||
..style.height = '100%';
|
||||
|
||||
ui.platformViewRegistry.registerViewFactory(_createdViewId, (int viewId) => iframe);
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_webInit = Future.value(true);
|
||||
});
|
||||
}
|
||||
_webInit = Future.value(true);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -413,9 +397,19 @@ class _HtmlContentViewerOnWebState extends State<HtmlContentViewerOnWeb>
|
||||
future: _webInit,
|
||||
builder: (_, snapshot) {
|
||||
if (snapshot.hasData) {
|
||||
final htmlView = HtmlElementView(
|
||||
final htmlView = HtmlElementView.fromTagName(
|
||||
key: ValueKey('$_htmlData-${widget.key}'),
|
||||
viewType: _createdViewId,
|
||||
tagName: 'iframe',
|
||||
onElementCreated: (element) {
|
||||
(element as html.IFrameElement)
|
||||
..width = _actualWidth.toString()
|
||||
..height = _actualHeight.toString()
|
||||
..srcdoc = _htmlData ?? ''
|
||||
..style.border = 'none'
|
||||
..style.overflow = 'hidden'
|
||||
..style.width = '100%'
|
||||
..style.height = '100%';
|
||||
},
|
||||
);
|
||||
|
||||
if (widget.viewMaxHeight != null) {
|
||||
|
||||
@@ -400,6 +400,7 @@ class ComposerBindings extends BaseBindings {
|
||||
Get.delete<CreateNewAndSaveEmailToDraftsInteractor>(tag: composerId);
|
||||
Get.delete<RestoreEmailInlineImagesInteractor>(tag: composerId);
|
||||
Get.delete<PrintEmailInteractor>(tag: composerId);
|
||||
Get.delete<SaveTemplateEmailInteractor>(tag: composerId);
|
||||
|
||||
IdentityInteractorsBindings(composerId: composerId).dispose();
|
||||
PreferencesInteractorsBindings(composerId: composerId).dispose();
|
||||
|
||||
@@ -58,4 +58,17 @@ class CalendarEventInteractorBindings extends InteractorsBindings {
|
||||
Get.find<HtmlDataSource>(),
|
||||
));
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
Get.delete<CalendarEventDataSource>();
|
||||
Get.delete<CalendarEventAPI>();
|
||||
Get.delete<CalendarEventDataSourceImpl>();
|
||||
Get.delete<ParseCalendarEventInteractor>();
|
||||
Get.delete<AcceptCalendarEventInteractor>();
|
||||
Get.delete<MaybeCalendarEventInteractor>();
|
||||
Get.delete<RejectCalendarEventInteractor>();
|
||||
Get.delete<AcceptCounterCalendarEventInteractor>();
|
||||
Get.delete<CalendarEventRepository>();
|
||||
Get.delete<CalendarEventRepositoryImpl>();
|
||||
}
|
||||
}
|
||||
@@ -34,4 +34,12 @@ class MdnInteractorBindings extends InteractorsBindings {
|
||||
void bindingsRepositoryImpl() {
|
||||
Get.lazyPut(() => MdnRepositoryImpl(Get.find<MdnDataSource>()));
|
||||
}
|
||||
|
||||
void dispose() {
|
||||
Get.delete<MdnDataSource>();
|
||||
Get.delete<MdnDataSourceImpl>();
|
||||
Get.delete<SendReceiptToSenderInteractor>();
|
||||
Get.delete<MdnRepository>();
|
||||
Get.delete<MdnRepositoryImpl>();
|
||||
}
|
||||
}
|
||||
@@ -93,6 +93,7 @@ import 'package:tmail_ui_user/features/email/domain/usecases/send_receipt_to_sen
|
||||
import 'package:tmail_ui_user/features/email/domain/usecases/store_opened_email_interactor.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/action/email_ui_action.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/bindings/calendar_event_interactor_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/bindings/mdn_interactor_bindings.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/extensions/attachment_extension.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_attendee_extension.dart';
|
||||
import 'package:tmail_ui_user/features/email/presentation/extensions/calendar_organizer_extension.dart';
|
||||
@@ -265,6 +266,8 @@ class SingleEmailController extends BaseController with AppLoaderMixin {
|
||||
_downloadProgressStateController.close();
|
||||
_attachmentListScrollController.dispose();
|
||||
emailScrollController.dispose();
|
||||
CalendarEventInteractorBindings().dispose();
|
||||
MdnInteractorBindings().dispose();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user