Skip to content

Commit 9e26517

Browse files
pstromberg98kt3k
authored andcommitted
Fixed memory leak when blurring tab during transitions (#2589)
* Fixed memory leak with inactive tabs * Minor fix * Moved inacitve tab memory leak fix * Rolled up build files closes #2558 closes #2057
1 parent 085a8c0 commit 9e26517

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

c3.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* @license C3.js v0.6.13 | (c) C3 Team and other contributors | http://c3js.org/ */
1+
/* @license C3.js v0.6.17 | (c) C3 Team and other contributors | http://c3js.org/ */
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
44
typeof define === 'function' && define.amd ? define(factory) :
@@ -2249,9 +2249,15 @@
22492249
};
22502250

22512251
ChartInternal.prototype.generateWait = function () {
2252+
var $$ = this;
2253+
22522254
var transitionsToWait = [],
22532255
f = function f(callback) {
22542256
var timer = setInterval(function () {
2257+
if (!$$.isTabVisible()) {
2258+
return;
2259+
}
2260+
22552261
var done = 0;
22562262
transitionsToWait.forEach(function (t) {
22572263
if (t.empty()) {

c3.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/js/c3.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* @license C3.js v0.6.13 | (c) C3 Team and other contributors | http://c3js.org/ */
1+
/* @license C3.js v0.6.17 | (c) C3 Team and other contributors | http://c3js.org/ */
22
(function (global, factory) {
33
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
44
typeof define === 'function' && define.amd ? define(factory) :
@@ -2249,9 +2249,15 @@
22492249
};
22502250

22512251
ChartInternal.prototype.generateWait = function () {
2252+
var $$ = this;
2253+
22522254
var transitionsToWait = [],
22532255
f = function f(callback) {
22542256
var timer = setInterval(function () {
2257+
if (!$$.isTabVisible()) {
2258+
return;
2259+
}
2260+
22552261
var done = 0;
22562262
transitionsToWait.forEach(function (t) {
22572263
if (t.empty()) {

docs/js/c3.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,9 +1112,14 @@ ChartInternal.prototype.endall = function(transition, callback) {
11121112
});
11131113
};
11141114
ChartInternal.prototype.generateWait = function() {
1115+
var $$ = this;
11151116
var transitionsToWait = [],
11161117
f = function(callback) {
11171118
var timer = setInterval(function() {
1119+
if (!$$.isTabVisible()) {
1120+
return;
1121+
}
1122+
11181123
var done = 0;
11191124
transitionsToWait.forEach(function(t) {
11201125
if (t.empty()) {

0 commit comments

Comments
 (0)