mg_schematic: fix leak in lua API, and small cleanup
authorest31 <MTest31@outlook.com>
Mon, 28 Mar 2016 12:39:43 +0000 (14:39 +0200)
committerest31 <MTest31@outlook.com>
Wed, 30 Mar 2016 14:26:05 +0000 (16:26 +0200)
commit0aac1b74037ba0f6b0526e81ad0ea7367e31c224
tree68fdb96cb3121615a98d250092ad5a6d3c5e6e76
parent0115da1d6348a08388238d8728daaa048a603522
mg_schematic: fix leak in lua API, and small cleanup

* Fix leak like behaviour if you load multiple schematics in a loop.

* Cleanup check in for, fixing theoretical out of bounds read if
Schematic::deserializeFromMts reduced the number of elements
in m_nodenames. A != check may need an overflow of the counter
before it hits, if origsize is larger than m_nodenames.size().

* Fix function name passed to errorstream: it was wrong. Also use
__FUNCTION__ instead of manually using the method name at other
places in the function.

* Don't shadow the name member in the loop.
src/mg_schematic.cpp