File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -134,10 +134,18 @@ class JpegLoaderApp final : public application_templates::MonoAssetManagerAndBui
134134 if (path.has_extension () && path.extension () == " .jpg" )
135135 {
136136 files.emplace_back (std::move (path.generic_string ()));
137- tp.enqueue ([=] {
138- m_logger->log (" Loading %S" , ILogger::ELL_INFO, path.c_str ());
139- m_assetMgr->getAsset (path.generic_string (), loadParams);
140- });
137+
138+ ISystem::future_t <smart_refctd_ptr<system::IFile>> future;
139+ m_system->createFile (future, path, IFile::ECF_READ);
140+
141+ if (auto pFile = future.acquire (); pFile && pFile->get ())
142+ {
143+ auto & file = *pFile;
144+ tp.enqueue ([=] {
145+ m_logger->log (" Loading %S" , ILogger::ELL_INFO, path.c_str ());
146+ m_assetMgr->getAsset (file.get (), path.generic_string (), loadParams);
147+ });
148+ }
141149 }
142150 }
143151 }
You can’t perform that action at this time.
0 commit comments