bitovi/canjs — pull request #310 by iamnoah (2013-03-13 14:02:41+00:00)
Title: Prevent leak from computes that have no bindings.

If the same event triggers an update to a compute AND
the same event also unbinds the compute, it can result in
the compute having bindings = 0, but still haveing a bound
onchanged handler.

This results in unecessary recomputes and can leak Models in
the Model store.

I know the test case seems very esoteric, but it's actually quite easy to get into this situation with live binding:
```html
{{#if computeA}}
{{#if computeB}}
Whatever
{{/if}}
{{/if}}
```

Whenever computeA = false, computeB should be unbound (since it is no longer rendered), but because the same event that unbinds computeB also triggers a recompute of B, B's onchanged handler will still be called, even though bindings === 0. It then binds normally, which causes the leak, since teardown has already been called and the original bindings context is lost.