File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -105,13 +105,14 @@ class CFileArchive : public IFileArchive
105
105
}
106
106
107
107
protected:
108
- CFileArchive (path&& _defaultAbsolutePath, system::logger_opt_smart_ptr&& logger, core::vector<SListEntry > _items) :
108
+ CFileArchive (path&& _defaultAbsolutePath, system::logger_opt_smart_ptr&& logger, core::vector<IFileArchive::SFileList::SEntry > _items) :
109
109
IFileArchive(std::move(_defaultAbsolutePath),std::move(logger))
110
110
{
111
- m_items = std::move (_items);
112
- std::sort (m_items.begin (),m_items.end ());
111
+ auto itemsSharedPtr = std::make_shared<std::vector<IFileArchive::SFileList::SEntry>>(std::move (_items));
112
+ std::sort (itemsSharedPtr->begin (), itemsSharedPtr->end ());
113
+ m_items.store (itemsSharedPtr);
113
114
114
- const auto fileCount = m_items. size ();
115
+ const auto fileCount = itemsSharedPtr-> size ();
115
116
m_filesBuffer = (std::byte*)_NBL_ALIGNED_MALLOC (fileCount*SIZEOF_INNER_ARCHIVE_FILE, ALIGNOF_INNER_ARCHIVE_FILE);
116
117
m_fileFlags = (std::atomic_flag*)_NBL_ALIGNED_MALLOC (fileCount*sizeof (std::atomic_flag), alignof (std::atomic_flag));
117
118
for (size_t i=0u ; i<fileCount; i++)
You can’t perform that action at this time.
0 commit comments