Enterprise-ng: Memory leak on soho-toolbar.component

Created on 31 Jul 2019  路  13Comments  路  Source: infor-design/enterprise-ng

'.more' - 'mouseover' event was not unsubscribed on ngOnDestroy() causing a memory leak on the soho-toolbar component.

To Reproduce

  1. Dynamically create a '\'
  2. Remove the '\'
  3. Repeat several times
  4. On developer tools, check Heap Snapshot, all instances of soho-toolbar is still retained.

Expected behavior
soho-toolbar should be freed from memory after use. 'mouseover' event should be unsubscribed on ngOnDestroy().

Version

  • ids-enterprise-ng: 5.4.2

Screenshots
'mouseover' event was not removed:
image

Platform

  • Device: PC
  • OS Version: Windows 10
  • Browser Name chrome
  • Browser Version
[3] high type

All 13 comments

This issue may be fixed by addresing https://github.com/infor-design/enterprise/issues/2496

Assigning @EdwardCoyle to see if we can address this when solving https://github.com/infor-design/enterprise/issues/2496

We need this one in 5.5.x

@GMInf nice find! We've been looking for memory leaks so it's nice to find another we can squash.

@pwpatton he's done a PR but i dont know what he needs to do to get it over here https://github.com/GMInf/enterprise-ng/pull/1 do you want to just recreate the PR here on a branch for @GMInf ?

@tmcconechy We'd need that PR against 5.5.x

This is the change I'm about to PR.

  ngOnDestroy() {
    // call outside the angular zone so change detection isn't triggered by the soho component.
    this.ngZone.runOutsideAngular(() => {
      if (this.jQueryElement) {
        this.jQueryElement.off();
        this.jQueryElement.find('.more').off();
      }
      if (this.toolbar) {
        this.toolbar.destroy();
        this.toolbar = null;
      }
    });
  }

I'll PR and include @GMInf as an approver

@tmcconechy yea, this fixes only the soho-toobar memory leak and the ep/toolbar still seems to be leaking memory.

OK waiting for your PR to approve. Thanks!

Hi! We are currently using ids-enterprise-ng 5.4.2. Will this fix be included in that version too? Or do we need to upgrade to 5.5 to get the fix? Thanks!

@GMInf

You would need 5.5 for the fix. We don't normally backport fixes to old versions unless it is a blocker.

Moving this ticket to the Done folder. There is no way for QA to test this ticket.

Was this page helpful?
0 / 5 - 0 ratings