很不言自明。这是导致“新向量”行出现 SIGABRT 的方法:
vector<string> * Task::arguments() {
vector<string> *args = new vector<string>(); // CAUSES SIGABRT
int count = sizeof(_arguments);
for (int x = 0; x < count; x++) {
string argument(_arguments[x]);
args->push_back(argument);
}
return args;
}
请注意,我在其他地方称该行没有任何问题。以下是 Task 类中包含的列表:
#include <vector>
#include <unistd.h>
#include <string>
using namespace std;
#include <sys/types.h>
#include <sys/wait.h>
#include <signal.h>
有什么想法吗?