Re: [sdljava-users] Possible memory leak in SWIG_SDLVideo
Status: Beta
Brought to you by:
ivan_ganza
From: Ivan Z. G. <iva...@ya...> - 2006-09-17 19:30:42
|
Greetings, Thanks for finding this. Yes this is a serious problem. I need to do figure out how to get SWIG to set that flag to true instead of false, then the leak should be eleminated. The code there is auto-generated by SWIG from the .i files. In the worst case I can manually run a script after to post-process that stuff and fix it that way. Either way it will be fixed. Cheers, -Ivan/ Jesper Juul / Soup Games wrote: >I wanted to post about this for a long time - I agre there is a leak >. So far I've worked around it by wrapping all Surfaces in a custom >object that calls dispose() in the finalizer. > > >-Jesper > > > >>I was wondering a long time why my application needs more and more RAM. >>I took a while to track down a possible memory leak. >>It seems to be located in sdljava.x.swig.SWIG_SDLVideo . >> >>The following methods seems to be affected: >>SDL_ConvertSurface(), SDL_DisplayFormat() and SDL_DisplayFormatAlpha() >> >>I am not sure at the moment, but maybe other methods have the same problem: >>SDL_SetVideoMode(), SDL_CreateRGBSurface(), SWIG_SDL_LoadBMP(), >>SWIG_SDL_CreateRGBSurfaceFrom() >> >>Please have a look at the last line of all methods: >>return (cPtr == 0) ? null : new SDL_Surface(cPtr, false); >> >>As you can easily see, false indicates that the new surface cannot free >>the memory because some other surface seems to also use it. But this is >>not true, the surface has just been created, no other surface does own >>this memory area. >> >>So this bug should be fixed when setting the second argument of the >>surface constructors to true. >> >>Ivan, would you please verify the problem? >>Thank you. >> >>Best Regards, >>Patric >> >> > > >------------------------------------------------------------------------- >Using Tomcat but need to do more? Need to support web services, security? >Get stuff done quickly with pre-integrated technology to make your job easier >Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo >http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 >_______________________________________________ >sdljava-users mailing list >sdl...@li... >https://lists.sourceforge.net/lists/listinfo/sdljava-users > > |