[PATCH] dmloader: Stop after find first matching object.

Alistair Leslie-Hughes leslie_alistair at hotmail.com
Fri Nov 22 02:22:35 CST 2019

This stops a crash in Legoland on startup when finding cached objects.
Placing a break in each of the if's causes the wrong object to be loaded.

The help states it looks at each type in order. So, we might have to loop
the cache multiple times to ensure that when an object has flag DMUS_OBJ_OBJECT,
it's preferred over a DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH match.

I hope this simple change will be accepted until a proper solution is implemented.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
 dlls/dmloader/loader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
index 0da8323e7e5..69a438765d5 100644
--- a/dlls/dmloader/loader.c
+++ b/dlls/dmloader/loader.c
@@ -208,6 +208,7 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_GetObject(IDirectMusicLoader8 *ifac
 				TRACE(": not loaded yet\n");
 				pObjectEntry = pExistingEntry;
+			break;
 		else if ((pDesc->dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&
 				(pExistingEntry->Desc.dwValidData & (DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH)) &&

More information about the wine-devel mailing list