Fix some memory leaks.
svn-id: r47284
This commit is contained in:
parent
62a87101d5
commit
af1ba42298
2 changed files with 12 additions and 3 deletions
|
@ -154,8 +154,11 @@ bool VirtualKeyboardParser::parserCallback_mode(ParserNode *node) {
|
|||
} else {
|
||||
// remove data relating to old resolution
|
||||
_mode->bitmapName.clear();
|
||||
delete _mode->image;
|
||||
_mode->image = 0;
|
||||
if (_mode->image) {
|
||||
_mode->image->free();
|
||||
delete _mode->image;
|
||||
_mode->image = 0;
|
||||
}
|
||||
_mode->imageMap.removeAllAreas();
|
||||
_mode->displayArea = Rect();
|
||||
}
|
||||
|
|
|
@ -121,7 +121,13 @@ protected:
|
|||
OverlayColor displayFontColor;
|
||||
|
||||
Mode() : image(0) {}
|
||||
~Mode() { delete image; }
|
||||
~Mode() {
|
||||
if (image) {
|
||||
image->free();
|
||||
delete image;
|
||||
image = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
typedef HashMap<String, Mode, IgnoreCase_Hash, IgnoreCase_EqualTo> ModeMap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue