CleverRaven/Cataclysm-DDA — pull request #9536 by BevapDin (2014-10-13 14:47:47+00:00)
Title: Fixes the memory leaks from the field class.

The field class stored `field_entry` objects as pointers. The class did not cleanup those pointers at all. They get removed correctly only when a field is removed via `map::remove_field` and similar.

But when the submap that contained the field gets deleted, the `field_entry` stay valid and are not cleaned up at all. This is fixed here.

I also added documentation / moved documentation into the header so that it's recognized by doxygen.

Also the constness is enhanced. non-const access to the field is only possible via a protected function (`map::get_field(x,y)`) used by the code in field.cpp. The other function to get fields (`map::field_at(x,y)`) returns a const field reference now. This should allow the `submap::fieldCount` to be "more" accurate. Other code has been updated to use the field functions of the map (e.g. instead of `m.field_at(x,y).findField(f)` it's `m.get_field(x,y,f)`).