Not sure what exactly you need. But the PKG_DEL scripts might do something similar. See: https://docs.octave.org/latest/Creating-Packages.html
Essentially, these scripts are executed whenever the path containing them is removed from Octave's load path. That is happening on pkg unload. (But admittedly, it's not a real hook but just a script.)
Maybe you could use (mlocked) functions that keep some values stored in persistent variables if you need to access them from the PKG_DEL script?
Not sure what exactly you need. But the
PKG_DEL
scripts might do something similar. See: https://docs.octave.org/latest/Creating-Packages.html Essentially, these scripts are executed whenever the path containing them is removed from Octave's load path. That is happening onpkg unload
. (But admittedly, it's not a real hook but just a script.) Maybe you could use (mlock
ed) functions that keep some values stored in persistent variables if you need to access them from thePKG_DEL
script?Originally posted by @mmuetzel in https://github.com/cbm755/octsympy/issues/1175#issuecomment-1175083790