diff --git a/liboctave/util/oct-shlib.cc b/liboctave/util/oct-shlib.cc --- a/liboctave/util/oct-shlib.cc +++ b/liboctave/util/oct-shlib.cc @@ -78,8 +78,6 @@ namespace octave : m_count (1), m_fcn_names (), m_file (f), m_time_loaded (), m_search_all_loaded (false) { - s_instances[f] = this; - if (is_out_of_date ()) (*current_liboctave_warning_with_id_handler) ("Octave:warn-future-time-stamp", @@ -93,39 +91,6 @@ namespace octave return (fs && fs.is_newer (m_time_loaded)); } - void - dynamic_library::dynlib_rep::fake_reload (void) - { - // We can't actually reload the library, but we'll pretend we did. - sys::file_stat fs (m_file); - if (fs && fs.is_newer (m_time_loaded)) - { - m_time_loaded = fs.mtime (); - - (*current_liboctave_warning_with_id_handler) - ("Octave:library-reload", - "library %s not reloaded due to existing references", m_file.c_str ()); - } - } - - dynamic_library::dynlib_rep * - dynamic_library::dynlib_rep::get_instance (const std::string& f, bool fake) - { - dynlib_rep *retval = nullptr; - std::map::iterator p = s_instances.find (f); - if (p != s_instances.end ()) - { - retval = p->second; - retval->m_count++; - if (fake) - retval->fake_reload (); - } - else - retval = new_instance (f); - - return retval; - } - std::list dynamic_library::dynlib_rep::function_names (void) const { @@ -164,9 +129,6 @@ namespace octave return retval; } - std::map - dynamic_library::dynlib_rep::s_instances; - dynamic_library::dynlib_rep dynamic_library::s_nil_rep; #if defined (HAVE_DLOPEN_API) diff --git a/liboctave/util/oct-shlib.h b/liboctave/util/oct-shlib.h --- a/liboctave/util/oct-shlib.h +++ b/liboctave/util/oct-shlib.h @@ -61,10 +61,7 @@ namespace octave public: - virtual ~dynlib_rep (void) - { - s_instances.erase (m_file); - } + virtual ~dynlib_rep (void) { } virtual bool is_open (void) const { return false; } @@ -78,8 +75,6 @@ namespace octave // This method will be overridden conditionally. static OCTAVE_API dynlib_rep * new_instance (const std::string& f); - static OCTAVE_API dynlib_rep * get_instance (const std::string& f, bool fake); - sys::time time_loaded (void) const { return m_time_loaded; } @@ -102,10 +97,6 @@ namespace octave protected: - OCTAVE_API void fake_reload (void); - - static OCTAVE_API std::map s_instances; - // Set of hooked function names. typedef std::map::iterator fcn_names_iterator; typedef std::map::const_iterator fcn_names_const_iterator; @@ -124,8 +115,8 @@ namespace octave dynamic_library (void) : m_rep (&s_nil_rep) { m_rep->m_count++; } - dynamic_library (const std::string& f, bool fake = true) - : m_rep (dynlib_rep::get_instance (f, fake)) { } + dynamic_library (const std::string& f) + : m_rep (dynlib_rep::new_instance (f)) { } ~dynamic_library (void) {