File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
core/src/components/modal Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -1200,6 +1200,9 @@ export class Modal implements ComponentInterface, OverlayInterface {
12001200
12011201 if ( cachedParentWasRemoved || cachedParentDisconnected ) {
12021202 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 ;
12031206 }
12041207 }
12051208 } ) ;
@@ -1213,10 +1216,9 @@ export class Modal implements ComponentInterface, OverlayInterface {
12131216 }
12141217
12151218 private cleanupParentRemovalObserver ( ) {
1216- if ( this . parentRemovalObserver ) {
1217- this . parentRemovalObserver . disconnect ( ) ;
1218- this . parentRemovalObserver = undefined ;
1219- }
1219+ this . parentRemovalObserver ?. disconnect ( ) ;
1220+ this . parentRemovalObserver = undefined ;
1221+ this . cachedOriginalParent = undefined ;
12201222 }
12211223
12221224 render ( ) {
You can’t perform that action at this time.
0 commit comments