Fix intlGUIEditBox leak and uninitialized value in Mapper (reported by valgrind)
authorKahrl <kahrl@gmx.net>
Mon, 10 Aug 2015 06:36:55 +0000 (08:36 +0200)
committerKahrl <kahrl@gmx.net>
Mon, 10 Aug 2015 06:41:45 +0000 (08:41 +0200)
src/guiFormSpecMenu.cpp
src/minimap.cpp

index f168306191e4d626b87dcd26fb24f66334c284ff..62a84460f9f9b26c7ad9984302933db660649b4c 100644 (file)
@@ -1020,6 +1020,7 @@ void GUIFormSpecMenu::parseSimpleField(parserData* data,
                if (g_settings->getBool("freetype")) {
                        e = (gui::IGUIElement *) new gui::intlGUIEditBox(spec.fdefault.c_str(),
                                true, Environment, this, spec.fid, rect);
+                       e->drop();
                } else {
 #else
                {
@@ -1119,6 +1120,7 @@ void GUIFormSpecMenu::parseTextArea(parserData* data,
                if (g_settings->getBool("freetype")) {
                        e = (gui::IGUIEditBox *) new gui::intlGUIEditBox(spec.fdefault.c_str(),
                                true, Environment, this, spec.fid, rect);
+                       e->drop();
                } else {
 #else
                {
index 950202c6a4f8895bce0cc8ed16b6779d0ac31126..d1fb3867db4150c720145a3574e2cf9f1a6f13ec 100644 (file)
@@ -224,12 +224,13 @@ Mapper::Mapper(IrrlichtDevice *device, Client *client)
 
        // Initialize minimap data
        data = new MinimapData;
-       data->mode            = MINIMAP_MODE_OFF;
-       data->is_radar        = false;
-       data->map_invalidated = true;
-       data->heightmap_image = NULL;
-       data->minimap_image   = NULL;
-       data->texture         = NULL;
+       data->mode              = MINIMAP_MODE_OFF;
+       data->is_radar          = false;
+       data->map_invalidated   = true;
+       data->heightmap_image   = NULL;
+       data->minimap_image     = NULL;
+       data->texture           = NULL;
+       data->heightmap_texture = NULL;
        data->minimap_shape_round = g_settings->getBool("minimap_shape_round");
 
        // Get round minimap textures