mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
prevent occasional assertion failure
This commit is contained in:
parent
36c0a0fd2e
commit
f6030da8bc
@ -244,6 +244,7 @@ store(BamCacheRecord *record) {
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
BamWriter writer(&dout, temp_pathname);
|
||||
if (!writer.init()) {
|
||||
temp_pathname.unlink();
|
||||
@ -270,6 +271,11 @@ store(BamCacheRecord *record) {
|
||||
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();
|
||||
temp_file.close();
|
||||
|
||||
@ -752,6 +758,7 @@ do_write_index(Filename &index_pathname, const BamCacheIndex *index) {
|
||||
return false;
|
||||
}
|
||||
|
||||
{
|
||||
BamWriter writer(&dout, index_pathname);
|
||||
if (!writer.init()) {
|
||||
index_pathname.unlink();
|
||||
@ -762,6 +769,7 @@ do_write_index(Filename &index_pathname, const BamCacheIndex *index) {
|
||||
index_pathname.unlink();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
index_file.close();
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user