The provided code has a leak as was suggested above. More over, it creates a new subscription each time the foo method completion is called which might not be desirable. Instead, capture the cancelable into a separate optional variable, call cancel before assigning new cancelable, use second weak reference in the internal observer.