显然 SDL_Mixer 中的这个函数一直在消亡,我不知道为什么。有没有人有任何想法?根据 Visual Studio 的说法,崩溃是由 Windows 在 realloc() 行中的某处触发断点引起的。
有问题的代码来自 SDL_Mixer 的 SVN 版本,如果这有所作为的话。
static void add_music_decoder(const char *decoder)
{
void *ptr = realloc(music_decoders, num_decoders * sizeof (const char **));
if (ptr == NULL) {
return; /* oh well, go on without it. */
}
music_decoders = (const char **) ptr;
music_decoders[num_decoders++] = decoder;
}
我正在使用 Visual Studio 2008,music_decoders 和 num_decoders 都是正确的(music_decoders 包含一个指针,指向字符串“WAVE”和 music_decoders。ptr 是 0x00000000,我能说的最好的,崩溃似乎是在 realloc () 函数。有谁知道我该如何处理这个崩溃问题?如果归根结底,我不介意为了使这项工作正常进行一些重构。