Skip to content

Commit

Permalink
Update base.js to fix race condition
Browse files Browse the repository at this point in the history
In Chrome, the ObjectUrl was being revoked before the image fully loaded.  If you wrap that revoke into an onload handler for the image, it solves that problem.
  • Loading branch information
justingish committed May 19, 2015
1 parent c96ce4f commit f512361
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion html5demos/indexeddb/js/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
imgElephant.setAttribute("src", imgURL);

// Revoking ObjectURL
URL.revokeObjectURL(imgURL);
imgElephant.onload = function() {
window.URL.revokeObjectURL(this.src);
}
};
};

Expand Down

0 comments on commit f512361

Please sign in to comment.