mirror of https://gitee.com/bigwinds/arangodb
In the function: RemoveAllLockedFiles(void), if we call TRI_RemoveVectorString() and TRI_RemoveVector() the next elements in the vector will be memmoved to the left. The next iteration of the loop will check the element at position 1 (but we are skipping the new element at position 0), so these calls have been removed.
The other alternative would be to have a loop: while (FileNames._length > 0) and take always the element at position 0. But this has the disadvantage that we are performing memmove() when later the vectors will be freed anyway.
This commit is contained in:
parent
5da5715fa9
commit
72c8847324
|
@ -179,12 +179,10 @@ static void RemoveAllLockedFiles (void) {
|
|||
|
||||
for (i = 0; i < FileNames._length; i++) {
|
||||
TRI_UnlinkFile(FileNames._buffer[i]);
|
||||
TRI_RemoveVectorString(&FileNames, i);
|
||||
|
||||
fd = * (int*) TRI_AtVector(&FileDescriptors, i);
|
||||
|
||||
TRI_CLOSE(fd);
|
||||
TRI_RemoveVector(&FileDescriptors, i);
|
||||
}
|
||||
|
||||
TRI_DestroyVectorString(&FileNames);
|
||||
|
|
Loading…
Reference in New Issue