Skip to content

Commit dfa0bf8

Browse files
author
Philip Guo
committed
added a warning about memory leaks
1 parent 8a611b9 commit dfa0bf8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

‎v3/js/pytutor.js‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,6 +2466,13 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
24662466
// delete all connectors. do this AS LATE AS POSSIBLE so that
24672467
// (presumably) the calls to $(this).empty() earlier in this function
24682468
// will properly garbage collect the connectors
2469+
//
2470+
// WARNING: for environment parent pointers, garbage collection doesn't seem to
2471+
// be working as intended :(
2472+
//
2473+
// I suspect that this is due to the fact that parent pointers are SIBLINGS
2474+
// of stackFrame divs and not children, so when stackFrame divs get destroyed,
2475+
// their associated parent pointers do NOT.)
24692476
myViz.jsPlumbInstance.reset();
24702477

24712478

@@ -2480,9 +2487,6 @@ ExecutionVisualizer.prototype.renderDataStructures = function() {
24802487
function renderParentPointerConnector(srcID, dstID) {
24812488
// SUPER-DUPER-ugly hack since I can't figure out a cleaner solution for now:
24822489
// if either srcID or dstID no longer exists, then SKIP rendering ...
2483-
//
2484-
// Note that until we solve this problem once and for all and no longer need this
2485-
// hacky guard, there will likely be MEMORY LEAKS associated with rendering parent pointers
24862490
if ((myViz.domRoot.find('#' + srcID).length == 0) ||
24872491
(myViz.domRoot.find('#' + dstID).length == 0)) {
24882492
return;

0 commit comments

Comments
 (0)