Browse Source

Fix bx::dlclose when passing NULL handle.

Бранимир Караџић 3 years ago
parent
commit
4921078d1e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/os.cpp

+ 5 - 0
src/os.cpp

@@ -191,6 +191,11 @@ namespace bx
 
 
 	void dlclose(void* _handle)
 	void dlclose(void* _handle)
 	{
 	{
+		if (NULL == _handle)
+		{
+			return;
+		}
+
 #if BX_PLATFORM_WINDOWS
 #if BX_PLATFORM_WINDOWS
 		::FreeLibrary( (HMODULE)_handle);
 		::FreeLibrary( (HMODULE)_handle);
 #elif  BX_PLATFORM_EMSCRIPTEN \
 #elif  BX_PLATFORM_EMSCRIPTEN \