1
0
Fork 0

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:
Guido Reina 2013-08-15 18:36:41 +02:00
parent 5da5715fa9
commit 72c8847324
1 changed files with 0 additions and 2 deletions

View File

@ -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);