-
Notifications
You must be signed in to change notification settings - Fork 23
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
LDClient::close() does not clean up the internal instances
map.
#108
Comments
Currently, I have:
it works, but I would rather not have this hack in my code. Thanks. |
Hi @valeriyo, Could you let us know your use case for re-initializing the client? In general this isn't a feature we consider supported on our mobile SDKs, as the SDK lifecycle is considered tied to the application's lifecycle. Thanks, |
Our app has an "environment" switch for Production vs Staging (with our server), and those are mapped to two Launchdarkly environments - which map to two different keys. So, when the app switches to another environment, everything that is environment-specific needs to be cleaned up. What's unusual about that? |
This specific case is actually addressed separately with the multi-environment feature. Take a look at the docs here. You can set either Production or Staging as the primary instance, and identify the other with Hope this helps! |
@gwhelanLD No, the multi-environment feature doesn't mitigate the fact that |
Having the same issue with the project I'm on. We need to be able to dynamically configure the LD config and reinitialise the client each time it updates so that the new configuration takes effect. Is there any reason why Thanks |
Alright, this is brain-dead. Is it so hard to add a line to make this right?
I was considering LD for a new project, but I will look elsewhere because you suck. Bye. |
Fixed this in the 3.1.8 release. |
This sequence:
does not work. The second
init()
call will succeed, but the LD library will be non-operational.This is happening because, LDClient has a static
instances
map, which isn't cleared byclose()
:So, the second
init()
will findinstances
and will bail out early:Please do
instances = null
at the end ofcloseInstances()
so that library can be re-initialized. Thanks.The text was updated successfully, but these errors were encountered: