Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible "memory effect" on .rx.location #44

Open
Narayane opened this issue Mar 19, 2021 · 0 comments
Open

Possible "memory effect" on .rx.location #44

Narayane opened this issue Mar 19, 2021 · 0 comments

Comments

@Narayane
Copy link

Narayane commented Mar 19, 2021

Hi,

I am using several instances of CLLocationManager (configured slightly differently) potentially at the same time and scoped to dedicated Rx streams (for each, I initiate a new CLLocationManager() that I specifically configure, then I call startUpdatingLocation() at stream's subscription, and I call stopUpdatingLocation() at the disposal) returning what the RxCoreLocation extension .rx.location provides me in the meantime.

In this context, I have, among other things, one method that returns to me an Observable<CLLocation> every second (distanceFilter == kCLDistanceFilterNone) and another every 30m traveled (distanceFilter == 30).
In a very specific case, I noticed a kind of "memory effect" (without fully understanding it yet) when I subscribed to a new 30m stream it returned to me all the data of the last 1Hz stream that I disposed, a few seconds before. It's very strange.

Is this strange behaviour possible there?

public var location: Observable<CLLocation?> 
    let updatedLocation = self.didUpdateLocations.map { $1.last } // <--- possible memory effect here?
    let location =  self.observe(CLLocation.self, .location)
    return Observable.of(location, updatedLocation).merge()
}

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant