- 论坛徽章:
- 0
|
贴一段android的代码:
// static
void MediaPlayerService::AudioOutput::CallbackWrapper( //此函数为callback的函数
int event, void *cookie, void *info) {
......
AudioOutput *me = data->getOutput();
AudioTrack::Buffer *buffer = (AudioTrack::Buffer *)info;
if (me == NULL) { //执行这句话之后 me析构 ,这样me就是个野指针了啊
// no output set, likely because the track was scheduled to be reused
// by another player, but the format turned out to be incompatible.
data->unlock();
if (buffer != NULL) {
buffer->size = 0;
}
return;
}
color=Red]//执行这句话之后 me析构 ,这样me就是个野指针了啊,后面再访问me就是访问也指针
|
|