DynamoDS/Dynamo — pull request #3033 by ke-yu (2014-11-11 09:43:52+00:00)
Title: Fix magn5353

This pull request fixes defect [MAGN-5353 GC: Remove a variable doesn't dispose the variable] (http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5353). The original defect is [MAGN-5311 GC: The old element is not deleted when input is switched to another subgraph] (http://adsk-oss.myjetbrains.com/youtrack/issue/MAGN-5311).

The defect can be simplified to the following case:
```
g1 = ... some proto geometry;
g2 = ... some proto geometry;
```
and when we switch between
```
r = Revit.Element.ImportInstance.ByGeometries(g1);
```
and
```
r = Revit.Element.ImportInstance.ByGeometries(g2);
```
, ``r`` is not properly disposed on Revit. That's because, there are some temporary variables generated when compiling ``r = ...`` (other non-relevant temporary variables are removed):

```
...
t1 = Revit.Element.ImportInstance.ByGeometries(g1);
r = t1;
```

Here we need to remove the reference from ``t1`` to Revit geometry when ``r`` is re-assigned to new value. This is done through ``AssociativeGraph.UpdateGraphNodeDependency()`` which does nothing when
1. the inspected graph node (here ``r = t1``) is not active, or
2. old graph node has same ``guid`` and ``ssaExprId``as the new one.

But if the statement is from same UI node, for 1), the old graph node will be deactivated by delta computation and 2) as they are from same UI node, they will have same ``guid`` and ``ssaExprId``.

The fix is to remove these two checking.

Run ProtoTest and DynamoCoreTests to verify no regression.

Add language test case RegressMAGN5353

@junmendoza please review the change.