在我的应用程序结束时,我只需调用以下命令进行清理。
delete [] array1;
delete [] array2;
delete [] array3;
delete [] array4;
delete [] array5;
delete [] array6;
delete [] array7;
delete [] array8;
delete [] array9;
delete [] array10;
delete [] array11;
delete [] array12;
delete [] array13;
13 个指向堆上数组的指针。在调试模式下它需要一个绝对的时间......比如 3-5 分钟,它实际上应该是瞬时的。是什么赋予了?
更新:我假设我正在删除一个 C 风格的结构数组(即只有基元和指针的结构),但是其中两个数组中有 hash_maps,这需要花费大量时间来清理。