You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ItielBeeri Thanks for the PR and my apologies for the delayed response.
If I understand correctly, by returning null from InitializeLifetimeService we are making the lifetime of the TransformationContextProvider service infinite. Does that mean that the service instances created for each transformation will not be released, creating a memory leak?
If so, can we avoid the memory leak by making the TransformationContextProvider.Register add service to the IServiceContainer as a single object instance instead of a ServiceCreatorCallback?
Alternatively, can we keep the lifetime as is and avoid the object disconnected error (#54) by making the TransformationContext get the ITransformationContextProvider service every time it's needed instead of getting it once at the start of the transformation?
@olegsych, thanks for your reply.
I thought VS anyway manages the provider lifetime to be a singleton through the VS instance lifetime, just returns different values on various transformations.
Apparently I wrong, and indeed, your both suggestions could prevent the memory leak. The later seems more robust, by avoiding retain a static instance, but it might fail if TransformationContextProvider will evolve in a way so it will depend on an internal state. What do you think?
Anyway, I'll try out both approaches and will come back soon with a better solution.
The reason will be displayed to describe this comment to others. Learn more.
please merge this into master
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #54