diff libinterp/corefcn/interpreter-private.h @ 27321:eddce82a57cc

don't use singleton pattern for gh_manager object * interpreter.h, interpreter.cc (interpreter::m_gh_manager): New data member. (interpreter::interpreter): Initialize it. (interpreter::get_gh_manager): New function. * interpreter-private.h, interpreter-private.cc (__get_gh_manager__): New function. * graphics.in.h, graphics.cc (gh_manager::instance): Delete. (gh_manager::m_interpreter): New data member. (gh_manager::gh_manager): Accept reference to interpreter as argument. Make public. (gh_manager::create_instance): Delete. (gh_manager& gh_manager::instance): New member function. Replace direct uses of previous global instance variable with this function to access gh_manager from interpreter object. (gh_manager::instance_ok): Delete. Change all uses to assume that the gh_manager instance is always present. (gh_manager::cleanup_instance): Delete.
author John W. Eaton <jwe@octave.org>
date Mon, 05 Aug 2019 10:42:18 -0500
parents 5f170ea12fa1
children 5e0f6db9428f
line wrap: on
line diff
--- a/libinterp/corefcn/interpreter-private.h	Mon Aug 05 10:29:21 2019 -0500
+++ b/libinterp/corefcn/interpreter-private.h	Mon Aug 05 10:42:18 2019 -0500
@@ -30,6 +30,8 @@
 
 #include "symtab.h"
 
+class gh_manager;
+
 namespace octave
 {
   class bp_table;
@@ -56,6 +58,8 @@
 
   extern error_system& __get_error_system__ (const std::string& who);
 
+  extern gh_manager& __get_gh_manager__ (const std::string& who);
+
   extern help_system& __get_help_system__ (const std::string& who);
 
   extern history_system& __get_history_system__ (const std::string& who);