# HG changeset patch # User John W. Eaton # Date 1645154677 18000 # Node ID b92316e295a21fc3b39b7dd6d0fc6a529fc0a004 # Parent 076e19eac74ad741bd93646a35093ce76562efd2 new class to help manage octave_value reps for dynamically loaded files * ov-base.h (octave_base_dld_value): New class. diff -r 076e19eac74a -r b92316e295a2 libinterp/octave-value/ov-base.h --- a/libinterp/octave-value/ov-base.h Thu Feb 17 22:21:03 2022 -0500 +++ b/libinterp/octave-value/ov-base.h Thu Feb 17 22:24:37 2022 -0500 @@ -40,6 +40,7 @@ #include "mx-base.h" #include "str-vec.h" +#include "auto-shlib.h" #include "oct-hdf5-types.h" #include "oct-stream.h" @@ -913,6 +914,28 @@ DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA }; +class +OCTINTERP_API +octave_base_dld_value : public octave_base_value +{ +public: + + octave_base_dld_value (void) = default; + + ~octave_base_dld_value (void) + { + m_containing_dynamic_library.delete_later (); + } + + octave_base_dld_value (const octave_base_dld_value&) = default; + + octave_base_dld_value& operator = (const octave_base_dld_value&) = default; + +private: + + octave::auto_shlib m_containing_dynamic_library; +}; + // TRUE means to perform automatic sparse to real mutation if there // is memory to be saved extern OCTINTERP_API bool Vsparse_auto_mutate;