Skip to content

Commit

Permalink
fix the undue discarding of logger events in edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed May 7, 2016
1 parent b23a0e9 commit b61fb33
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/js/logger-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,8 @@ var renderLogEntry = function(entry) {
}

rowFilterer.filterOne(tr, true);

tbody.insertBefore(tr, tbody.firstChild);
return tr;
};

/******************************************************************************/
Expand All @@ -565,14 +565,16 @@ var renderLogEntries = function(response) {

var tabIds = response.tabIds;
var n = entries.length;
var entry;
var entry, tr;
for ( var i = 0; i < n; i++ ) {
entry = entries[i];
// Unlikely, but it may happen
tr = renderLogEntry(entries[i]);
// https://github.com/gorhill/uBlock/issues/1613#issuecomment-217637122
// Unlikely, but it may happen: mark as void if associated tab no
// longer exist.
if ( entry.tab && tabIds.hasOwnProperty(entry.tab) === false ) {
continue;
tr.classList.remove('canMtx');
}
renderLogEntry(entries[i]);
}

// Prevent logger from growing infinitely and eating all memory. For
Expand Down

0 comments on commit b61fb33

Please sign in to comment.