100pah commented on PR #20161:
URL: https://github.com/apache/echarts/pull/20161#issuecomment-2233732870

   Just some extra records of this case:
   
   It seems to be caused by:
   
   ```js
           const oldData = this._data;
           // ...
           const changePolyState = (toState: DisplayState) => {
               this._changePolyState(toState);
           };
           data.eachItemGraphicEl(function (el) {
               el && ((el as ECElement).onHoverStateChange = changePolyState);
           });
   ```
   
   A closure of `changePolyState` references to `oldData`, and `oldData` 
references to the previous `changePolyState`s.
   As a result, all of the `oldData`s are not released.
   
   <img width="431" alt="image" 
src="https://github.com/user-attachments/assets/515047a5-058e-49eb-978b-d24c996bc26a";>
   
   
   ---
   
   Theoretically, it's need to check whether is kind of case occurs in other 
`render` functions that contain `oldData` and element listener.
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to