mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
don't remove correct file when failing to rename the incorrect one
This commit is contained in:
parent
69985789f1
commit
e640f676e0
@ -274,7 +274,7 @@ store(BamCacheRecord *record) {
|
||||
temp_file.close();
|
||||
|
||||
// Now move the file into place.
|
||||
if (!temp_pathname.rename_to(cache_pathname)) {
|
||||
if (!temp_pathname.rename_to(cache_pathname) && temp_pathname.exists()) {
|
||||
cache_pathname.unlink();
|
||||
if (!temp_pathname.rename_to(cache_pathname)) {
|
||||
util_cat.error()
|
||||
|
Loading…
x
Reference in New Issue
Block a user