# HG changeset patch # User jwe # Date 1161221255 0 # Node ID 8010902404b9715417f686e6be3781e28b096368 # Parent a813714cb04b9f0c9c4beb96e7bdbf2f93d67e1f [project @ 2006-10-19 01:27:35 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,13 @@ 2006-10-18 John W. Eaton + * dynamic-ld.cc (octave_shlib_list::remove, + octave_shlib_list::do_remove, octave_mex_file_list::remove, + octave_mex_file_list::do_remove): New arg, cl_hook. + (octave_shlib_list::do_remove): Pass cl_hook to octave_shlib close + function. + (octave_dynamic_loader::do_load_oct): Don't call close on shl + directly. Pass do_clear_function to octave_shlib_list::remove. + * mex.cc (mexUnlock): Don't warn if unlocking a function that is not locked. diff --git a/src/dynamic-ld.cc b/src/dynamic-ld.cc --- a/src/dynamic-ld.cc +++ b/src/dynamic-ld.cc @@ -49,7 +49,7 @@ static void append (const octave_shlib& shl); - static void remove (octave_shlib& shl); + static void remove (octave_shlib& shl, octave_shlib::close_hook cl_hook = 0); static void *search (const std::string& fcn_name, octave_shlib& shl, octave_shlib::name_mangler mangler = 0); @@ -62,7 +62,7 @@ void do_append (const octave_shlib& shl); - void do_remove (octave_shlib& shl); + void do_remove (octave_shlib& shl, octave_shlib::close_hook cl_hook = 0); void *do_search (const std::string& fcn_name, octave_shlib& shl, octave_shlib::name_mangler mangler = 0); @@ -90,16 +90,16 @@ } void -octave_shlib_list::do_remove (octave_shlib& shl) +octave_shlib_list::do_remove (octave_shlib& shl, + octave_shlib::close_hook cl_hook) { - for (std::list::iterator p = lib_list.begin (); p != lib_list.end (); p++) { if (*p == shl) { - shl.close (); + shl.close (cl_hook); lib_list.erase (p); @@ -159,10 +159,11 @@ } void -octave_shlib_list::remove (octave_shlib& shl) +octave_shlib_list::remove (octave_shlib& shl, + octave_shlib::close_hook cl_hook) { if (instance_ok ()) - instance->do_remove (shl); + instance->do_remove (shl, cl_hook); } void * @@ -179,7 +180,7 @@ static void append (const octave_shlib& shl); - static void remove (octave_shlib& shl); + static void remove (octave_shlib& shl, octave_shlib::close_hook cl_hook = 0); private: @@ -189,7 +190,7 @@ void do_append (const octave_shlib& shl); - void do_remove (octave_shlib& shl); + void do_remove (octave_shlib& shl, octave_shlib::close_hook cl_hook = 0); static octave_mex_file_list *instance; @@ -214,7 +215,8 @@ } void -octave_mex_file_list::do_remove (octave_shlib& shl) +octave_mex_file_list::do_remove (octave_shlib& shl, + octave_shlib::close_hook cl_hook) { for (std::list::iterator p = file_list.begin (); @@ -223,7 +225,7 @@ { if (*p == shl) { - shl.close (); + shl.close (cl_hook); file_list.erase (p); @@ -258,10 +260,11 @@ } void -octave_mex_file_list::remove (octave_shlib& shl) +octave_mex_file_list::remove (octave_shlib& shl, + octave_shlib::close_hook cl_hook) { if (instance_ok ()) - instance->do_remove (shl); + instance->do_remove (shl, cl_hook); } octave_dynamic_loader *octave_dynamic_loader::instance = 0; @@ -327,7 +330,7 @@ "reloading %s clears the following functions:", oct_file.file_name().c_str ()); - oct_file.close (do_clear_function); + octave_shlib_list::remove (oct_file, do_clear_function); function = 0; }