File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
core/src/components/modal Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1200,6 +1200,9 @@ export class Modal implements ComponentInterface, OverlayInterface {
1200
1200
1201
1201
if ( cachedParentWasRemoved || cachedParentDisconnected ) {
1202
1202
this . dismiss ( undefined , 'parent-removed' ) ;
1203
+ // Release the reference to the cached original parent
1204
+ // so we don't have a memory leak
1205
+ this . cachedOriginalParent = undefined ;
1203
1206
}
1204
1207
}
1205
1208
} ) ;
@@ -1213,10 +1216,8 @@ export class Modal implements ComponentInterface, OverlayInterface {
1213
1216
}
1214
1217
1215
1218
private cleanupParentRemovalObserver ( ) {
1216
- if ( this . parentRemovalObserver ) {
1217
- this . parentRemovalObserver . disconnect ( ) ;
1218
- this . parentRemovalObserver = undefined ;
1219
- }
1219
+ this . parentRemovalObserver ?. disconnect ( ) ;
1220
+ this . parentRemovalObserver = undefined ;
1220
1221
}
1221
1222
1222
1223
render ( ) {
You can’t perform that action at this time.
0 commit comments