forked from OctaForge/OctaBuild
no need to disown, we can just copy
parent
492789f0a4
commit
e32a5a86ff
5
main.cc
5
main.cc
|
@ -417,10 +417,9 @@ int main(int argc, char **argv) {
|
||||||
os.cs.add_command("shell", "C", [](CsState &cs, ConstCharRange s) {
|
os.cs.add_command("shell", "C", [](CsState &cs, ConstCharRange s) {
|
||||||
auto cnt = ((ObState &)cs).counters.back();
|
auto cnt = ((ObState &)cs).counters.back();
|
||||||
cnt->incr();
|
cnt->incr();
|
||||||
char *ds = String(s).disown();
|
String ds = s;
|
||||||
tpool.push([cnt, ds]() {
|
tpool.push([cnt, ds]() {
|
||||||
int ret = system(ds);
|
int ret = system(ds.data());
|
||||||
delete[] ds;
|
|
||||||
if (ret && !cnt->result)
|
if (ret && !cnt->result)
|
||||||
cnt->result = ret;
|
cnt->result = ret;
|
||||||
cnt->decr();
|
cnt->decr();
|
||||||
|
|
Loading…
Reference in New Issue