3

I am currently using openAl in my game . I am getting the memory leak whose responsible frame is `

OALSource:AddPlaybackMessage

` What I am doing is that after my game finishes i delete all the buffers allocated to the Source and free other pcmdata pointers etc .. before the starting the game i re-initialize the source and their buffers with the audio data. At this stage am getting this leak. Any idea why its happening ..... Some posts say its a bug in apple's OpenAl library but i dont think so .. Apple must have done something about it ....

Thanks

Tornado
  • 1,069
  • 12
  • 28
  • I'm getting the same leak. I create and release a lot of sound sources and the leak happens quite randomly (maybe 1 in 10, maybe 1 in 50...) it happens more the faster I create and release. There's a post on the official apple forums as well with no responses as well... – ima747 Jan 11 '12 at 04:04
  • It is my post bro... but i figured it out ..check the answer below.. – Tornado Jan 12 '12 at 12:21
  • I sorted out my issue. I don't understand it but it was one of my sound files... using a different sound resolved the leaking. I tried re-creating the file in question 3 times before I finally got one that didn't leak... makes no sense to me, going to chalk it up as an Apple OpenAL lib issue but it seems resolved now. – ima747 Jan 12 '12 at 21:11
  • Below answer is what solved my issue but i don't find any logical point in it how it solved the issue... Frankly i don't think it matters now .. leak is gone ....cheers – Tornado Jan 16 '12 at 05:56

1 Answers1

0

ok Now am not getting any leaks from openAL .. What i have done is :-

  • While initializing sources again delete them first with their respective buffers and free any pcmData pointer.
  • regenerate sources and buffers.
  • Dont ever Delete openALContext and openALDevice . get context and device only once when your app starts . Delete them on Dealloc().

Hope this solves your openAl leak issues.

Cheers

Tornado
  • 1,069
  • 12
  • 28