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.30@20195 56274372-70c3-4bfc-bfc3-4c3a0b034d27
  • Loading branch information
manxorist committed Mar 3, 2024
1 parent 8137609 commit a5f9bb7
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 @@ -283,6 +283,10 @@ class library {

#endif

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

return library{hModule};
}

Expand Down

0 comments on commit a5f9bb7

Please sign in to comment.