环境:Ubuntu 11.04。SDL 1.2.15。
在我基于 SDL 的应用程序中,我一个接一个地播放多个视频剪辑。对于每个视频,我在开头调用 SDL_OpenAudio,最后调用 SDL_CloseAudio。但是,每一轮都会留下两个未释放的内存块。它们都来自内部 SDL 函数 AudioAvailable。
==17035== 372 bytes in 3 blocks are definitely lost in loss record 139 of 169
==17035== at 0x4C28F9F: malloc (vg_replace_malloc.c:236)
==17035== by 0xB2B0564: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==17035== by 0xB2B062A: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==17035== by 0xB2B01CA: xcb_connect_to_display_with_auth_info (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==17035== by 0xCC650ED: pa_client_conf_from_x11 (in /usr/lib/x86_64-linux-gnu/libpulsecommon-1.0.so)
==17035== by 0xC9ED83E: pa_context_new_with_proplist (in /usr/lib/x86_64-linux-gnu/libpulse.so.0.13.4)
==17035== by 0xC7DD9F2: pa_simple_new (in /usr/lib/x86_64-linux-gnu/libpulse-simple.so.0.0.3)
==17035== by 0x418AED: Audio_Available (SDL_pulseaudio.c:235)
==17035== by 0x405893: SDL_AudioInit (SDL_audio.c:360)
==17035== by 0x404A79: SDL_InitSubSystem (SDL.c:105)
==17035== by 0x405E59: SDL_OpenAudio (SDL_audio.c:404)
我想知道我的代码中是否有一些我可能做错的事情。我已经验证 SDL_CloseAudio 确实被调用了。