Skip to content

ignoreReferenceCount parameter in unregister method is not used #405

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

Open
z-chu opened this issue Apr 12, 2025 · 0 comments
Open

ignoreReferenceCount parameter in unregister method is not used #405

z-chu opened this issue Apr 12, 2025 · 0 comments

Comments

@z-chu
Copy link

z-chu commented Apr 12, 2025

In the unregister method, there is a parameter ignoreReferenceCount which is defined but not used in the implementation.

Current implementation:

if (factoryToRemove._referenceCount > 0) {
  factoryToRemove._referenceCount--;
  return;
}

The ignoreReferenceCount parameter should be used to control whether to ignore the reference count when unregistering. I suggest modifying the code to:

if (!ignoreReferenceCount && factoryToRemove._referenceCount > 0) {
  factoryToRemove._referenceCount--;
  return;
}

This would make the parameter work as expected:

  • When ignoreReferenceCount = false (default): keep current behavior
  • When ignoreReferenceCount = true: it will ignore the reference count and unregister the object
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