Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e2d5e8fd
Unverified
Commit
e2d5e8fd
authored
Nov 02, 2023
by
Binni Goel
Committed by
GitHub
Nov 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instrumented PipelineOwner for leak tracking (#137494)
parent
7308207c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
object.dart
packages/flutter/lib/src/rendering/object.dart
+14
-1
object_test.dart
packages/flutter/test/rendering/object_test.dart
+8
-0
No files found.
packages/flutter/lib/src/rendering/object.dart
View file @
e2d5e8fd
...
...
@@ -895,7 +895,17 @@ class PipelineOwner with DiagnosticableTreeMixin {
this
.
onSemanticsOwnerCreated
,
this
.
onSemanticsUpdate
,
this
.
onSemanticsOwnerDisposed
,
});
}){
// TODO(polina-c): stop duplicating code across disposables
// https://github.com/flutter/flutter/issues/137435
if
(
kFlutterMemoryAllocationsEnabled
)
{
MemoryAllocations
.
instance
.
dispatchObjectCreated
(
library
:
'package:flutter/rendering.dart'
,
className:
'
$PipelineOwner
'
,
object:
this
,
);
}
}
/// Called when a render object associated with this pipeline owner wishes to
/// update its visual appearance.
...
...
@@ -1433,6 +1443,9 @@ class PipelineOwner with DiagnosticableTreeMixin {
assert
(
rootNode
==
null
);
assert
(
_manifold
==
null
);
assert
(
_debugParent
==
null
);
if
(
kFlutterMemoryAllocationsEnabled
)
{
MemoryAllocations
.
instance
.
dispatchObjectDisposed
(
object:
this
);
}
_semanticsOwner
?.
dispose
();
_semanticsOwner
=
null
;
_nodesNeedingLayout
.
clear
();
...
...
packages/flutter/test/rendering/object_test.dart
View file @
e2d5e8fd
...
...
@@ -8,12 +8,20 @@ import 'package:flutter/foundation.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter/rendering.dart'
;
import
'package:flutter_test/flutter_test.dart'
;
import
'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart'
;
import
'rendering_tester.dart'
;
void
main
(
)
{
TestRenderingFlutterBinding
.
ensureInitialized
();
test
(
'PipelineOwner dispatches memory events'
,
()
async
{
await
expectLater
(
await
memoryEvents
(()
=>
PipelineOwner
().
dispose
(),
PipelineOwner
),
areCreateAndDispose
,
);
});
test
(
'ensure frame is scheduled for markNeedsSemanticsUpdate'
,
()
{
// Initialize all bindings because owner.flushSemantics() requires a window
final
TestRenderObject
renderObject
=
TestRenderObject
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment