-
-
Notifications
You must be signed in to change notification settings - Fork 153
Question: Memory Allocation and Performance of using Scopes #205
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
Comments
if your class implements |
Uhm, what do you mean by Dependency Graph? you might also check out the |
I didn't see examples of In the above example, its simple because there is only 1 type being referenced, but there could be other multiple objects depending on each other, and deregistering of one would lead to deregistering of others, kind of like a cascade or garbage collection. e.g. if LoggedInAccount had n dependencies and assuming those dependencies themselves don't have any other dependencies, would those still remain in memory or completely removed from getIt? Would it make a difference if those objects were I was mostly looking at the implementation of the Scope class to gain an understanding of where the disposing might happen. Seems like getIt.registerSingleton<Account>(NoAccount('no_account'), disposingFunction: (t) => t.dispose()); Is my understanding correct? |
Oh I was looking at master branch, I saw this exists in the nullsafety branch. Thanks that clarifies. |
Hi,
I wanted to get a deeper understanding of what happens when
popScope
is called.Assume that we have registered the following:
Will at the last line
popScope()
does it end up callingdispose()
on the dependency graph and registered instances/singletons? Or would they be lying around in memory even if the scope got disposed?The text was updated successfully, but these errors were encountered: