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

Will the Instance registered by Bind.lazyPut not be deleted? #3267

Open
zhao004 opened this issue Dec 4, 2024 · 7 comments
Open

Will the Instance registered by Bind.lazyPut not be deleted? #3267

zhao004 opened this issue Dec 4, 2024 · 7 comments
Assignees

Comments

@zhao004
Copy link

zhao004 commented Dec 4, 2024

Describe the bug

Will the Instance registered by Bind.lazyPut not be deleted?
Will this affect performance? Is there a way to delete the Instance registered by Bind.lazyPut from memory?

Screenshots

20241204152703
20241204152645
20241204152805

Flutter Version:

Flutter 3.24.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision dec2ee5c1f (3 weeks ago) • 2024-11-13 11:13:06 -0800
Engine • revision a18df97ca5
Tools • Dart 3.5.4 • DevTools 2.37.3

Getx Version:

[Enter the version of the Getx you are using](get: ^5.0.0-release-candidate-9.2.1)

@ZhuJHua
Copy link

ZhuJHua commented Dec 4, 2024

same question

@vtmnetdev
Copy link

vtmnetdev commented Dec 10, 2024

@zhao004 (Workaround) I found that, if you add 'fenix: false' when using Bind.lazyPut, the controller will be deleted on closing.

@ZhuJHua
Copy link

ZhuJHua commented Dec 10, 2024

(Workaround) I found that, if you add 'fenix: false' when using Bind.lazyPut, the controller will be deleted on closing.

So why the Bind set the fenix to true as default? I find that in Get.lazyPut, the fenix is false as default.

@jonataslaw
Copy link
Owner

Thanks for opening this issue.
The problem is with the fenix:true mode setting in the last update.
I'm still deciding if it will be the default.
Many users face problems with dependency not found (although this always happens when they use GetX improperly, starting dependencies in inappropriate places) but performance should be in mind along with ease of use.

@ZhuJHua
Copy link

ZhuJHua commented Dec 11, 2024

Thanks for opening this issue. The problem is with the fenix:true mode setting in the last update. I'm still deciding if it will be the default. Many users face problems with dependency not found (although this always happens when they use GetX improperly, starting dependencies in inappropriate places) but performance should be in mind along with ease of use.

Should I assume that I can set fenix to false for all Bind.lazyPut and get the same effect as Get.lazyPut?

@jonataslaw
Copy link
Owner

Yes, definetely

@ZhuJHua
Copy link

ZhuJHua commented Dec 11, 2024

Yes, definetely

Thanks for your response.

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

4 participants