[Commits] [wesnoth/wesnoth] 61ec2d: Minor fixup of 8f6a0830

GitHub noreply at github.com
Thu May 11 03:38:39 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: 61ec2d000898d2ca678cffee911bed16aa3bf223
      https://github.com/wesnoth/wesnoth/commit/61ec2d000898d2ca678cffee911bed16aa3bf223
  Author: Celtic Minstrel <celtic.minstrel.ca at some.place>
  Date:   2017-05-10 (Wed, 10 May 2017)

  Changed paths:
    M src/formula/formula.cpp
    M src/formula/formula.hpp

  Log Message:
  -----------
  Minor fixup of 8f6a0830

I think only the string initializer could actually throw.
(The memleak was caused by an exception in the constructor body.)
So, make sure the string is initialized last.
That way, there won't be an improper delete if it throws.
Just in case, also put the shared_ptr second-last.





More information about the Commits mailing list