aboutsummaryrefslogtreecommitdiff
path: root/backends/vkeybd/virtual-keyboard-parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/vkeybd/virtual-keyboard-parser.cpp')
-rw-r--r--backends/vkeybd/virtual-keyboard-parser.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/backends/vkeybd/virtual-keyboard-parser.cpp b/backends/vkeybd/virtual-keyboard-parser.cpp
index 7af6d2a49f..68e7c7ec75 100644
--- a/backends/vkeybd/virtual-keyboard-parser.cpp
+++ b/backends/vkeybd/virtual-keyboard-parser.cpp
@@ -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();
}