You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After fighting a memory leak in my app (involving dynamically generating/removing CDK drag-drop items - and those removed items still lingering around in memory) for longer than I'd like to admit, I finally figured out the memory leak only occurs when the cdkDrag items contain a cdkDragBoundary property.
This bug was introduced in release 8.2.0 (#16874) when _resizeSubscription was added.
All the subscriptions in the screenshot above are being unsubscribed in the dragRef._removeSubscriptions() method except for the _resizeSubscription.
As a result, the _resizeSubscription is not closed within the dragRef.dispose() method.
Simply adding this._resizeSubscription.unsubscribe(); to the dragRef._removeSubscriptions() method appears to fix the problem.
I just double checked and the memory leak I am experiencing does not occur on CDK v8.1.4.
Environment
Angular:
CDK/Material: 8.2.0+
Browser(s):
Operating System (e.g. Windows, macOS, Ubuntu):
The text was updated successfully, but these errors were encountered:
After fighting a memory leak in my app (involving dynamically generating/removing CDK drag-drop items - and those removed items still lingering around in memory) for longer than I'd like to admit, I finally figured out the memory leak only occurs when the
cdkDrag
items contain acdkDragBoundary
property.This bug was introduced in release 8.2.0 (#16874) when
_resizeSubscription
was added.All the subscriptions in the screenshot above are being unsubscribed in the
dragRef._removeSubscriptions()
method except for the_resizeSubscription
.As a result, the
_resizeSubscription
is not closed within thedragRef.dispose()
method.Simply adding
this._resizeSubscription.unsubscribe();
to thedragRef._removeSubscriptions()
method appears to fix the problem.I just double checked and the memory leak I am experiencing does not occur on CDK v8.1.4.
Environment
The text was updated successfully, but these errors were encountered: