Fixed a small memory leak and possible heap corruption
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@5948 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 95dc60b5da701b633e0c939ee5320c2704fcef2d Former-commit-id: 815eb3a5e9bae2690f1971c231a57ee1efc15fff
This commit is contained in:
parent
a277b33296
commit
64a87774c0
1 changed files with 10 additions and 1 deletions
|
@ -426,7 +426,15 @@ DisplayMenu::DisplayMenu()
|
|||
|
||||
DisplayMenu::~DisplayMenu()
|
||||
{
|
||||
free(_aColorDepths);
|
||||
int nDefColorDepths;
|
||||
int* aDefColorDepths = GfScrGetDefaultColorDepths(&nDefColorDepths);
|
||||
if (_aColorDepths && _aColorDepths != aDefColorDepths)
|
||||
free(_aColorDepths);
|
||||
|
||||
int nDefScreenSizes;
|
||||
tScreenSize* aDefScreenSizes = GfScrGetDefaultSizes(&nDefScreenSizes);
|
||||
if (_aScreenSizes && _aScreenSizes != aDefScreenSizes)
|
||||
free(_aScreenSizes);
|
||||
}
|
||||
|
||||
bool DisplayMenu::initialize(void *pPreviousMenu)
|
||||
|
@ -528,4 +536,5 @@ void* DisplayMenuInit(void *pPreviousMenu)
|
|||
void DisplayMenuRelease(void)
|
||||
{
|
||||
delete PDisplayMenu;
|
||||
PDisplayMenu = NULL;
|
||||
}
|
Loading…
Reference in a new issue