mlr-org / mlr3misc

Miscellaneous helper functions for mlr3
https://mlr3misc.mlr-org.com
GNU Lesser General Public License v3.0
11 stars 2 forks source link

Automatic cleanup when unloading a package #101

Open sebffischer opened 7 months ago

sebffischer commented 7 months ago

As mlr3 populates dictionaries from packages like mlr3 or mlr3pipelines when loading extensions, those objects should be removed again when unloading the extension. An idea brought forward by Lukas is to automate this, which I think is a good idea: https://github.com/mlr-org/mlr3proba/issues/301#issuecomment-1912164404

A simple solution would be to tag the dictionary entries with the package that added them. Then, during the .onUnload function, we can remove all objects that were added by the package that is being unloaded.