Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Date: Fri, 22 Jul 2005 23:12:49 +1000
From: Ian Munsie Subject: URGENT: SDL_mixer-1.2.6 bug fix (or two) bug info: When SDL_mixer attempted to initialise libmikmod, it used all drivers embedded in the libmikmod. Problem was, that the sound card drivers were already in use by SDL, so libmikmod would hang waiting for them to become free on many systems. As SDL_mixer uses a hook to transfer the final stream from libmikmod into SDL_mixer's mixer, there is no reason that libmikmod should be using a card driver at all, the nosound driver still does all the internal processing, and will still call the hook fine. bug info: Please read the libmikmod documentation more carefully, it clearly states that MikMod_InfoDriver() and MikMod_InfoLoader() uses malloc to dynamically allocate a char array to hold a list of drivers/loaders (as opposed to simply returning a pointer to a static char array, in which case your code would be fine), and that you must free() it after use. It should be fine to remove these statements completely (unless someone compiled libmikmod with no embeded drivers or loaders :S), but if you want to keep them, PLEASE store the return value of these functions in a temporary variable so you can free() them afterwards. Your code never frees that string, and as a result has a memory leak :(
- Loading branch information