mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-05 03:15:07 -04:00
prevent occasional assertion failure
This commit is contained in:
parent
36c0a0fd2e
commit
f6030da8bc
@ -244,6 +244,7 @@ store(BamCacheRecord *record) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
BamWriter writer(&dout, temp_pathname);
|
BamWriter writer(&dout, temp_pathname);
|
||||||
if (!writer.init()) {
|
if (!writer.init()) {
|
||||||
temp_pathname.unlink();
|
temp_pathname.unlink();
|
||||||
@ -270,6 +271,11 @@ store(BamCacheRecord *record) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Now that we are done with the BamWriter, it's important to let
|
||||||
|
// it destruct now and clean itself up, or it might get mad if we
|
||||||
|
// delete any TypedWritables below that haven't been written yet.
|
||||||
|
}
|
||||||
|
|
||||||
record->_record_size = temp_file.tellp();
|
record->_record_size = temp_file.tellp();
|
||||||
temp_file.close();
|
temp_file.close();
|
||||||
|
|
||||||
@ -752,6 +758,7 @@ do_write_index(Filename &index_pathname, const BamCacheIndex *index) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
BamWriter writer(&dout, index_pathname);
|
BamWriter writer(&dout, index_pathname);
|
||||||
if (!writer.init()) {
|
if (!writer.init()) {
|
||||||
index_pathname.unlink();
|
index_pathname.unlink();
|
||||||
@ -762,6 +769,7 @@ do_write_index(Filename &index_pathname, const BamCacheIndex *index) {
|
|||||||
index_pathname.unlink();
|
index_pathname.unlink();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
index_file.close();
|
index_file.close();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user