fix memory leak.

This commit is contained in:
pandx 2024-11-05 10:49:22 +08:00
parent cdbf8bee6e
commit abb04dc397

View File

@ -59,7 +59,7 @@ int SensorScheduler::WriteScheduleCfg(long &ts, std::string &world_time) {
for (int i = 0; i < available_slice_; ++i) {
ids.append(slice_allocation[i]);
}
delete slice_allocation;
delete []slice_allocation;
root["id"] = ids;
Json::StyledStreamWriter streamWriter;
std::ofstream out_file(SCHEDULE_CONFIG);