diff libinterp/corefcn/toplev.cc @ 24734:5d8c4cbc56d7

don't use singleton pattern for child_list * child-list.h, child-list.cc: Don't use singleton pattern. * interpreter.h, interpreter.cc (interpreter::m_child_list): New data member. (interpreter::get_child_list): New method. * interpreter-private.h, interpreter-private.cc (__get_child_list__): New function. * pager.cc, sighandlers.cc, toplev.cc: Access child_list through interpreter.
author John W. Eaton <jwe@octave.org>
date Sun, 11 Feb 2018 11:17:34 -0500
parents 194eb4bd202b
children daf61c7dfcae
line wrap: on
line diff
--- a/libinterp/corefcn/toplev.cc	Sun Feb 11 09:20:36 2018 -0500
+++ b/libinterp/corefcn/toplev.cc	Sun Feb 11 11:17:34 2018 -0500
@@ -53,6 +53,7 @@
 #include "error.h"
 #include "file-io.h"
 #include "help.h"
+#include "interpreter-private.h"
 #include "octave.h"
 #include "oct-map.h"
 #include "ovl.h"
@@ -103,9 +104,11 @@
   octave::unwind_protect frame;
 
   iprocstream *cmd = new iprocstream (cmd_str.c_str ());
+  frame.add_delete (cmd);
 
-  frame.add_delete (cmd);
-  frame.add_fcn (octave::child_list::remove, cmd->pid ());
+  octave::child_list& kids
+    = octave::__get_child_list__ ("run_command_and_return_output");
+  frame.add_method (kids, &octave::child_list::remove, cmd->pid ());
 
   if (! *cmd)
     error ("system: unable to start subprocess for '%s'", cmd_str.c_str ());