Skip to content

Commit

Permalink
Merge pull request #22 from dcleao/ANALYZER-3004
Browse files Browse the repository at this point in the history
[ANALYZER-3004] - Memory Leak when working with analysis report
  • Loading branch information
pamval committed Apr 30, 2015
2 parents 0a846e0 + 0488e89 commit 10fd5c7
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 51 deletions.
57 changes: 34 additions & 23 deletions protovis-d3.3.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* the license for the specific language governing your rights and limitations.
*/
/*! Copyright 2010 Stanford Visualization Group, Mike Bostock, BSD license. */
/*! b3bcf01fff70f1fcad2464fa4a700c22f9ed4596 */
/*! 0a846e02116638f4d7f3c88a223ee1ae23f0cb3f */
/**
* @class The built-in Array class.
* @name Array
Expand Down Expand Up @@ -11692,17 +11692,25 @@ pv.Mark.prototype.setPropertyValue = function(name, v, isDef, cast, chain, tag){
id: pv.id(),
value: v,
type: type,
tag: tag
tag: tag,
proto: null,
root: null,

// Used in #bind to connect the property chains
// found along a mark's proto chain.
_proto: null
};

p.root = p;

var specified = propertiesMap[name];
var existing = propertiesMap[name];

propertiesMap[name] = p;

if(specified) {
if(existing) {
// Find it and remove it
for(var i = 0, P = properties.length; i < P; i++) {
if(properties[i] === specified) {
if(properties[i] === existing) {
properties.splice(i, 1);
break;
}
Expand All @@ -11711,9 +11719,9 @@ pv.Mark.prototype.setPropertyValue = function(name, v, isDef, cast, chain, tag){

properties.push(p);

if(chain && specified && type === 3) { // is a prop fun
p.proto = specified;
p.root = specified.root || specified;
if(chain && existing && type === 3) { // is a prop fun
p.proto = existing;
p.root = existing.root;
}

return p;
Expand Down Expand Up @@ -12482,6 +12490,7 @@ pv.Mark.prototype.renderCore = function() {
*/
pv.Mark.prototype.bind = function() {
var seen = {},
root = {},
data,

// Required props (no defs)
Expand Down Expand Up @@ -12525,20 +12534,23 @@ pv.Mark.prototype.bind = function() {
var pLeaf = seen[name];
if(!pLeaf) {
seen[name] = p;
root[name] = p.root;
// Reset, from a previous binding
p.root._proto = null;
switch(name) {
case 'data': data = p; break;
case 'visible': case 'id': required.push(p); break;
default: types[p.type].push(p); break;
}
} else if(pLeaf.type === 3) { // prop/fun
// Chain properties
//
// seen[name]-> (leaf).proto-> (B).proto-> (C).proto-> (root)
// .root-------------------------------^
var pRoot = pLeaf.root;
pLeaf.root = p;
if(!pRoot) { pLeaf.proto = p; }
else if(!pRoot.proto) { pRoot.proto = p; }
} else {
var pRoot = root[name];
if(pRoot.type === 3) { // prop/fun
// Chain property chains of pRoot and p
pRoot._proto = p;
pRoot = root[name] = p.root;
// Reset, from a previous binding
pRoot._proto = null;
}
}
}
} while((mark = mark.proto));
Expand Down Expand Up @@ -12781,7 +12793,7 @@ pv.Mark.prototype.buildInstance = function(s) {

// 3 - prop - fun
function(p) {
_protoProp = p.proto;
_protoProp = p.proto || p._proto;
return p.value.apply(this, _stack);
}
];
Expand Down Expand Up @@ -22675,12 +22687,11 @@ pv.Behavior.point = function(keyArgs) {

// Initialize panel.
// Unpoint when the mouse leaves the pointing panel.
if(!pointingPanel && this.type === 'panel') {

if(pointingPanel) {
;
} else if(this.type === 'panel') {
pointingPanel = this;
pointingPanel.event('mouseout', function() {
mouseout.call(pointingPanel.scene.$g);
});
this.event('mouseout', function() { mouseout.call(this.scene.$g); });

if(stealClick) pointingPanel.addEventInterceptor('click', eventInterceptor);
} else {
Expand Down
12 changes: 6 additions & 6 deletions protovis-r3.3.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions src/behavior/Point.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,12 +342,11 @@ pv.Behavior.point = function(keyArgs) {

// Initialize panel.
// Unpoint when the mouse leaves the pointing panel.
if(!pointingPanel && this.type === 'panel') {

if(pointingPanel) {
;
} else if(this.type === 'panel') {
pointingPanel = this;
pointingPanel.event('mouseout', function() {
mouseout.call(pointingPanel.scene.$g);
});
this.event('mouseout', function() { mouseout.call(this.scene.$g); });

if(stealClick) pointingPanel.addEventInterceptor('click', eventInterceptor);
} else {
Expand Down
Loading

0 comments on commit 10fd5c7

Please sign in to comment.