Game Development Community

AudioBuffer potential leak

by Jeremiah Fulbright · in Torque Game Engine Advanced · 11/10/2006 (5:12 am) · 1 replies

This has been fixed in the past via some forum posts or a resource, but still hasn't made it into TSE for some reason. So I am just posting it here for others who haven't looked back thru the TGE forums for various bug fixes.

audioBuffer.cpp, around Line 365, you should find:

if(vf.ov_open(stream, NULL, 0) < 0) {
      return false;
   }

That needs to be changed to

if(vf.ov_open(stream, NULL, 0) < 0) {
	   ResourceManager->closeStream(stream);
	   return false;
   }

Otherwise, if something happens during the attempt to load an Ogg file, it could possibly leave a stream open.

#1
11/16/2006 (12:43 pm)
Strange. I thought TSE was merged with 1.5 just recently. But this still hasn't changed as of the TGEA4.1 download. There are several other audio fixes from 1.4.2 that haven't been rolled in either.

At least it only takes 15 minutes to patch it all up manually, that's not too bad.