Skip to content

Commit

Permalink
Fix memory leak when removing rows
Browse files Browse the repository at this point in the history
widmoser committed Jul 26, 2016
1 parent 1642783 commit 83c8afe
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 8 additions & 1 deletion dist/tileview.js
Original file line number Diff line number Diff line change
@@ -218,8 +218,15 @@
itemContainer.append(row);
return row;
}
function clearRow(row) {
while (row.children().length > 0) {
removeElementFromRow(row);
}
}
function removeRow() {
itemContainer.children().eq(-1).remove();
var row = itemContainer.children().eq(-1);
clearRow(row);
row.remove();
}
function addElementToRow(row) {
linkFunction(scope.$parent.$new(), function (clonedElement) {
10 changes: 9 additions & 1 deletion src/tileview.ts
Original file line number Diff line number Diff line change
@@ -250,8 +250,16 @@ declare const angular: any;
return row;
}

function clearRow(row) {
while (row.children().length > 0) {
removeElementFromRow(row);
}
}

function removeRow() {
itemContainer.children().eq(-1).remove();
const row = itemContainer.children().eq(-1);
clearRow(row);
row.remove();
}

function addElementToRow(row) {

0 comments on commit 83c8afe

Please sign in to comment.