changeset 30766:db0335e1b6e0 stable

Backed out changeset fc530ec01070 (bug #61994)
author John W. Eaton <jwe@octave.org>
date Sat, 19 Feb 2022 13:14:20 -0500
parents 81021f079387
children 753e48aa488c 6bc535476d5f
files libinterp/dldfcn/__init_fltk__.cc libinterp/dldfcn/__init_gnuplot__.cc
diffstat 2 files changed, 8 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/dldfcn/__init_fltk__.cc	Sat Feb 19 13:19:37 2022 +0100
+++ b/libinterp/dldfcn/__init_fltk__.cc	Sat Feb 19 13:14:20 2022 -0500
@@ -38,7 +38,6 @@
 #  include "config.h"
 #endif
 
-#include "auto-shlib.h"
 #include "defun-dld.h"
 #include "error.h"
 #include "errwarn.h"
@@ -2268,16 +2267,12 @@
 
   fltk_graphics_toolkit (octave::interpreter& interp)
     : octave::base_graphics_toolkit (FLTK_GRAPHICS_TOOLKIT_NAME),
-      m_interpreter (interp), input_event_hook_fcn_id (),
-      m_containing_dynamic_library ()
+      m_interpreter (interp), input_event_hook_fcn_id ()
   {
     Fl::visual (FL_RGB);
   }
 
-  ~fltk_graphics_toolkit (void)
-  {
-    m_containing_dynamic_library.delete_later ();
-  }
+  ~fltk_graphics_toolkit (void) = default;
 
   bool is_valid (void) const { return true; }
 
@@ -2489,8 +2484,6 @@
   octave::interpreter& m_interpreter;
 
   octave_value_list input_event_hook_fcn_id;
-
-  octave::auto_shlib m_containing_dynamic_library;
 };
 
 #endif
@@ -2530,6 +2523,8 @@
     error ("__init_fltk__: no graphics DISPLAY available");
   else if (! toolkit_loaded)
     {
+      interp.mlock ();
+
       octave::gtk_manager& gtk_mgr = interp.get_gtk_manager ();
 
       fltk_graphics_toolkit *fltk = new fltk_graphics_toolkit (interp);
--- a/libinterp/dldfcn/__init_gnuplot__.cc	Sat Feb 19 13:19:37 2022 +0100
+++ b/libinterp/dldfcn/__init_gnuplot__.cc	Sat Feb 19 13:14:20 2022 -0500
@@ -38,7 +38,6 @@
 
 #include <string>
 
-#include "auto-shlib.h"
 #include "dMatrix.h"
 #include "file-stat.h"
 #include "oct-env.h"
@@ -64,8 +63,7 @@
 {
 public:
   gnuplot_graphics_toolkit (octave::interpreter& interp)
-    : octave::base_graphics_toolkit ("gnuplot"), m_interpreter (interp),
-      m_containing_dynamic_library ()
+    : octave::base_graphics_toolkit ("gnuplot"), m_interpreter (interp)
   {
     static bool warned = false;
 
@@ -88,10 +86,7 @@
       }
   }
 
-  ~gnuplot_graphics_toolkit (void)
-  {
-    m_containing_dynamic_library.delete_later ();
-  }
+  ~gnuplot_graphics_toolkit (void) = default;
 
   bool is_valid (void) const { return true; }
 
@@ -205,8 +200,6 @@
   }
 
   octave::interpreter& m_interpreter;
-
-  octave::auto_shlib m_containing_dynamic_library;
 };
 
 static bool
@@ -269,6 +262,8 @@
 
       graphics_toolkit tk (new gnuplot_graphics_toolkit (interp));
       gtk_mgr.load_toolkit (tk);
+
+      interp.mlock ();
     }
 
   return octave_value_list ();