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
Currently globally defined features like messages (and in the near future facts) are never unregistered.
This is because of the assumption that they will not come from plugins. A plugin can define mixins, but it should not define new messages. There seems to be no use case for this. If a use case is identified, we should take some precautions to unregister these features, otherwise they will leak when the plugin is unloaded.
Possible ways how this can be done:
Add a domain to feature_info (like there is one in the mixin info) and unregister with a global instance holder, like the one for mixins and type classes. Feature info will become "fatter"
Add a global instance holder, but use the domain tag instead of a domain member in the info. This means that macros which define features will also have to have the domain tag as an argument which will make them more unpleasant (as if they aren't enough unpleasant already)
Add ref count to features in domain which is increased when a mixin is registered and decreased when it is unregistered. If it reaches zero, the feature is unregistered as well
Option 2 seems the worst to me, but I can't decide between 1 and 3.
The text was updated successfully, but these errors were encountered:
Currently globally defined features like messages (and in the near future facts) are never unregistered.
This is because of the assumption that they will not come from plugins. A plugin can define mixins, but it should not define new messages. There seems to be no use case for this. If a use case is identified, we should take some precautions to unregister these features, otherwise they will leak when the plugin is unloaded.
Possible ways how this can be done:
feature_info
(like there is one in the mixin info) and unregister with a global instance holder, like the one for mixins and type classes. Feature info will become "fatter"Option 2 seems the worst to me, but I can't decide between 1 and 3.
The text was updated successfully, but these errors were encountered: