REALLY fixed the leak (Dimitri)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -129,7 +129,7 @@ bool wxXPMHandler::SaveFile(wxImage * image,
|
|||||||
|
|
||||||
// 2. write the header:
|
// 2. write the header:
|
||||||
char tmpbuf[200];
|
char tmpbuf[200];
|
||||||
// VS: 200b is safe upper bound for anything produced by sprintf bellow
|
// VS: 200b is safe upper bound for anything produced by sprintf below
|
||||||
// (101 bytes the string, neither %i can expand into more than 10 chars)
|
// (101 bytes the string, neither %i can expand into more than 10 chars)
|
||||||
sprintf(tmpbuf,
|
sprintf(tmpbuf,
|
||||||
"/* XPM */\n"
|
"/* XPM */\n"
|
||||||
@@ -209,9 +209,17 @@ bool wxXPMHandler::SaveFile(wxImage * image,
|
|||||||
tmp = wxT("};\n");
|
tmp = wxT("};\n");
|
||||||
stream.Write(tmp.mb_str(), 3);
|
stream.Write(tmp.mb_str(), 3);
|
||||||
|
|
||||||
|
// Clean up:
|
||||||
delete[] symbols;
|
delete[] symbols;
|
||||||
delete[] symbols_data;
|
delete[] symbols_data;
|
||||||
|
|
||||||
|
// FIXME: it will be better to use macros-based wxHashTable & DeleteContents(TRUE)
|
||||||
|
table.BeginFind();
|
||||||
|
while ((node = table.Next()) != NULL)
|
||||||
|
{
|
||||||
|
delete (wxHNode *) node->GetData();
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user