mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 13:41:16 +01:00
Proper cleanup.
This commit is contained in:
parent
ad154dfd7d
commit
1a8114af8e
@ -73,12 +73,14 @@ bool Tar::loadTar()
|
|||||||
while ((ret = _file.read(buffer, BLOCKSIZE)) > 0) {
|
while ((ret = _file.read(buffer, BLOCKSIZE)) > 0) {
|
||||||
if (ret < BLOCKSIZE) {
|
if (ret < BLOCKSIZE) {
|
||||||
_file.close();
|
_file.close();
|
||||||
|
_index.clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
size = number(hdr->size, sizeof(hdr->size));
|
size = number(hdr->size, sizeof(hdr->size));
|
||||||
_index.insert(hdr->name, _file.pos() / BLOCKSIZE - 1);
|
_index.insert(hdr->name, _file.pos() / BLOCKSIZE - 1);
|
||||||
if (!_file.seek(_file.pos() + BLOCKCOUNT(size) * BLOCKSIZE)) {
|
if (!_file.seek(_file.pos() + BLOCKCOUNT(size) * BLOCKSIZE)) {
|
||||||
_file.close();
|
_file.close();
|
||||||
|
_index.clear();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user