export_vrml: Fix 3D model destination timestamp check
Not all hosts have `wxHAS_HUGE_FILES` enabled, which causes us to drop millisecond resolution accuracy. In some cases, this can cause race-conditions with externally generated components such as by KiBot (which generates THT components with color bands on the fly), which runs so fast, that we fall within a second resolution. When setting the destination timestamp, there's only two valid options. Either the destination file exists, and if it does, we use the destination file's timestamp (current behavior) or it does not exist, in which case we should use an 'invalid' (null, NaN, whatever). Calling the constructor sets this up correctly and then only setting the timestamp if the file exists. Nothing else. Signed-off-by: Olliver Schinagl <[email protected]> Fixes: https://gitlab.com/kicad/code/kicad/-/issues/20877
This commit is contained in:
committed by
Seth Hillbrand
parent
2baeecbee8
commit
cf3dbfbbe6
@@ -1127,9 +1127,7 @@ void EXPORTER_PCB_VRML::ExportVrmlFootprint( FOOTPRINT* aFootprint, std::ostream
|
||||
|
||||
// copy the file if necessary
|
||||
wxDateTime srcModTime = srcFile.GetModificationTime();
|
||||
wxDateTime destModTime = srcModTime;
|
||||
|
||||
destModTime.SetToCurrent();
|
||||
wxDateTime destModTime = wxDateTime();
|
||||
|
||||
if( dstFile.FileExists() )
|
||||
destModTime = dstFile.GetModificationTime();
|
||||
|
||||
Reference in New Issue
Block a user