Skip to content

Commit

Permalink
Merged revision(s) 20193 from trunk/OpenMPT:
Browse files Browse the repository at this point in the history
[Fix] mpt/library/library.hpp: When loading a library on Windows, do not return std::optional{NULL} if loading failed, but return std::nullopt instead. Otherwise, the code later gets confused as it finds a HANDLE (which is NULL) and assumes the library was loaded successfully. Non-Windows platforms were not affected. Fixes <https://bugs.openmpt.org/view.php?id=1749>.
........


git-svn-id: https://source.openmpt.org/svn/openmpt/branches/OpenMPT-1.31@20194 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Mar 3, 2024
1 parent 18d8b9c commit f987d15
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/mpt/library/library.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ class library {

#endif // MPT_OS_WINDOWS_WINRT

if (!hModule) {
return std::nullopt;
}

return library{hModule};
}

Expand Down

0 comments on commit f987d15

Please sign in to comment.