Do I need to complete a Subject for it to be garbage collected? : <p>I follow a cleanup pattern in my Angular components that looks like this:</p>

<pre><code>class SomeComponent implements OnInit, OnDestroy {
    private destroy$ = new Subject();

    ngOnInit() {
        service.someStream().takeUntil(this.destroy$).subscribe(doSomething);
    }

    ngOnDestroy() {
        this.destroy$.next(true);
    }
}
</code></pre>

<p>This has the benefit of automatically unsubscribing when the component is destroyed.</p>

<p>My question is: Does a reference to <code>destroy$</code> stick around indefinitely because I haven't called <code>this.destroy$.complete()</code>, or will it get GC'ed when the parent class is collected?</p>
