Spliting archive creates new parts only when starting to fill them
This commit is contained in:
@@ -44,7 +44,7 @@ namespace openVulkanoCpp
|
||||
|
||||
void MultiPartArchiveWriter::CheckSize(size_t size)
|
||||
{
|
||||
if (m_fileSizeLimit < m_writer->GetTotalWrittenBytes() + size)
|
||||
if (!m_writer || m_fileSizeLimit < m_writer->GetTotalWrittenBytes() + size)
|
||||
{
|
||||
StartNewFile();
|
||||
}
|
||||
@@ -105,6 +105,6 @@ namespace openVulkanoCpp
|
||||
void MultiPartArchiveWriter::Split()
|
||||
{
|
||||
if (!m_writer->GetTotalWrittenBytes()) return; // Nothing has been written yet, no need to split file
|
||||
StartNewFile();
|
||||
m_writer = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user