This repository has been archived by the owner on Nov 24, 2018. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
1. valdrMessage-directive [major]
Cause: the directive registers event listener on the $rootScope which it is not unregistered when the directive is destroyed.
Consequence: The $rootScope retains reference to the directive scope and element through the event handler's function closure. The scope and the element have references to their parent and children, which means that large piece of $scope and DOM objects will remain in memory after their use because they are not eligible for garbage collection. This causes major memory leaks due to the fact that the $rootScope is singleton service and will be alive though out the whole application operation time.
2. valdrFormGroup-directive [minor]
Cause: valdrFormGroup controller retains reference to the valdrMessage elements for the former valdrFormItems.
Consequence: former valdrMessage elements cannot be garbage collected after their removal from the DOM. However this is not a major memory leak because it is temporary i.e. while the valdrFormGroup directive instance is alive.