/* Try to load the dll again, if refcounting is ok, this should work */
hModule1 = LoadLibraryA(path1);
- todo_wine ok(hModule1 != NULL, "LoadLibrary(%s) failed\n", path1);
+ ok(hModule1 != NULL, "LoadLibrary(%s) failed\n", path1);
if (hModule1 != NULL)
ok(FreeLibrary(hModule1), "FreeLibrary() failed\n");
}
}
}
- if (info.status != STATUS_SUCCESS) return info.status;
+ if (info.status != STATUS_SUCCESS)
+ {
+ wine_dll_unload( handle );
+ return info.status;
+ }
if (!info.wm)
{
break;
}
}
+ wine_dll_unload( handle ); /* release the libdl refcount */
if (!info.wm) return STATUS_INVALID_IMAGE_FORMAT;
if (info.wm->ldr.LoadCount != -1) info.wm->ldr.LoadCount++;
}