Mercurial > octave
changeset 32193:e82a6eec8880
load_path: Additional cleanup when removing non-existent directories in cset 65781d62fee7.
* load-path.cc (load_path::update): Check for any hook function on removal and call that
if present. Call remove() on non-existent directory to cleanly remove it from Octave
before deleting it from m_dir_info_list.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Mon, 10 Jul 2023 20:24:07 +0200 |
parents | 372b73895c89 |
children | b9cabe8a9fb0 |
files | libinterp/corefcn/load-path.cc |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/load-path.cc Wed Jul 12 11:00:07 2023 -0700 +++ b/libinterp/corefcn/load-path.cc Mon Jul 10 20:24:07 2023 +0200 @@ -436,6 +436,12 @@ ("Octave:load-path:update-failed", "load-path: update failed for '%s', removing from path", di->dir_name.c_str ()); + + if (m_remove_hook) + m_remove_hook (di->dir_name.c_str ()); + + remove (*di); + di = m_dir_info_list.erase (di); } else