1
0
Fork 0

use delete instead of free, although this code is never really used, as the running process should have been replaced at that point.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4263
This commit is contained in:
Peter Veenstra 2019-10-01 11:11:57 +00:00
parent 5803ea448c
commit ca20ca3a3e

View file

@ -1866,11 +1866,11 @@ extern void DEBUG_ShutDown(Section * /*sec*/);
#endif
void restart_program(std::vector<std::string> & parameters) {
char** newargs = new char* [parameters.size()+1];
char** newargs = new char* [parameters.size() + 1];
// parameter 0 is the executable path
// contents of the vector follow
// last one is NULL
for(Bitu i = 0; i < parameters.size(); i++) newargs[i]=(char*)parameters[i].c_str();
for(Bitu i = 0; i < parameters.size(); i++) newargs[i] = (char*)parameters[i].c_str();
newargs[parameters.size()] = NULL;
SDL_CloseAudio();
SDL_Delay(50);
@ -1892,7 +1892,7 @@ void restart_program(std::vector<std::string> & parameters) {
#endif
E_Exit("Restarting failed");
}
free(newargs);
delete [] newargs;
}
void Restart(bool pressed) { // mapper handler
restart_program(control->startup_params);