Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有内存泄漏问题 #1

Open
flymedream opened this issue Jan 23, 2019 · 0 comments
Open

有内存泄漏问题 #1

flymedream opened this issue Jan 23, 2019 · 0 comments

Comments

@flymedream
Copy link

accompany_decoder.cpp第147行:

AudioPacket* AccompanyDecoder::decodePacket(){ // LOGI("MadDecoder::decodePacket packetBufferSize is %d", packetBufferSize); short* samples = new short[packetBufferSize]; // LOGI("accompanyPacket buffer's addr is %x", samples); int stereoSampleSize = readSamples(samples, packetBufferSize); AudioPacket* samplePacket = new AudioPacket(); if (stereoSampleSize > 0) { //构造成一个packet samplePacket->buffer = samples; samplePacket->size = stereoSampleSize; /** 这里由于每一个packet的大小不一样有可能是200ms 但是这样子position就有可能不准确了 **/ samplePacket->position = position; } else { samplePacket->size = -1; } return samplePacket; }
中的
AudioPacket* samplePacket = new AudioPacket();new了一个AudioPacket结构体,没有delete,导致内存泄漏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant