[Plib-users] Memory Leaks
Brought to you by:
sjbaker
From: Alejo, L. W. <al...@ws...> - 2001-05-23 13:51:17
|
Has anyone tried to incorporate plib into a MSVC++ MFC application? I am in the process of developing an MFC application utilizing plib (mainly ssg) and the current snapshot of plib in cvs.sourceforge.net produces a multiple number of memory leaks, as reported by BoundsChecker. I have made an attempt, on my version of plib, to squash a few of these memory leaks and respectfully offer the following code changes to the contributors of plib for consideration and inclusion into the library. Changes: In ssg.h: virtual ~ssgLoaderOptions() { if (model_dir) { delete model_dir; model_dir = 0; } if (texture_dir) { delete texture_dir; texture_dir = 0; } } In ssgTexture.cxx: ssgTexture::~ssgTexture (void) { if (filename != NULL) { delete [] filename; filename = NULL; } free_handle () ; } In ssgLoadSGI.cxx, added dtor: ssgSGIHeader::~ssgSGIHeader(void) { if (start != NULL) delete [] start; if (leng != NULL) delete [] leng; } I also discovered conflicting multiple definitions for macro _SSG_PUBLIC: ssglocal.h: #define _SSG_PUBLIC public ssg.h: #ifndef _SSG_PUBLIC #define _SSG_PUBLIC protected #endif -Larry |