File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -82,17 +82,16 @@ namespace xcpp
82
82
83
83
interpreter_ptr build_interpreter (int argc, char ** argv)
84
84
{
85
- int interpreter_argc = argc; // + 1;
86
- const char ** interpreter_argv = new const char *[interpreter_argc];
85
+ std::vector<const char *> interpreter_argv (argc);
87
86
interpreter_argv[0 ] = " xeus-cpp" ;
88
- // Copy all arguments in the new array excepting the process name.
87
+
88
+ // Copy all arguments in the new vector excepting the process name.
89
89
for (int i = 1 ; i < argc; i++)
90
90
{
91
91
interpreter_argv[i] = argv[i];
92
92
}
93
93
94
- interpreter_ptr interp_ptr = std::make_unique<interpreter>(interpreter_argc, interpreter_argv);
95
- delete[] interpreter_argv;
94
+ interpreter_ptr interp_ptr = std::make_unique<interpreter>(argc, interpreter_argv.data ());
96
95
return interp_ptr;
97
96
}
98
97
You can’t perform that action at this time.
0 commit comments