I have an observable that I want to release the memory that is uses. When setting in to null, the Garbage Collector is not collecting it becuase other he is referenced in some subscription.
The question is - how can I remove all the subscribers?
for example:
creating:
this.x = ko.observable();
removing:
this.x(null);
but it is not removed becuase it is referenced in some subscription:
this.y.subscribe(function (newValue) {
var z = this.x();
};
I dont want to dispose
the subscription - becacuse for a new value for x
I want y
to subscribe to it.
I hope it is clear.
Thanks