Skip to content

Commit

Permalink
vsort/win32.cpp: fix crash when vsmlrt-cuda does not exist, and also …
Browse files Browse the repository at this point in the history
…skip non-DLL files

Signed-off-by: akarin <[email protected]>
  • Loading branch information
AkarinVS committed Dec 8, 2021
1 parent 53dcaaa commit 86aace1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vsort/win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,14 @@ void preloadCudaDlls() {
std::map<std::wstring, std::filesystem::path> dllmap;

auto findDllIn = [&](const std::filesystem::path &dir) {
if (!std::filesystem::is_directory(dir))
return;
for (const auto &ent: std::filesystem::directory_iterator{dir}) {
if (!ent.is_regular_file())
continue;
const auto path = ent.path();
if (path.extension() != ".dll")
continue;
const std::wstring filename = path.filename().wstring();
for (const auto &dll: cudaDlls) {
if (dllmap.count(dll) > 0)
Expand Down

0 comments on commit 86aace1

Please sign in to comment.