widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #01009
Re: [Merge] lp:~csirkeee/widelands/memory-leaks-2 into lp:widelands
Now I changed the interface to have pointers, and meanwhile found a few more bad uses...
I think the real optimal solution would be to move to C++11 and return std::unique_ptr-s, that can be caught by its move constructor outside :)
With this change I wanted to unify which abstraction level handles the deletion of these pointers, so that "low level" file-accessing code looks at it as just a reference, and those that handle the location and filenames and such do the work. I couldn't completely do this because of the way Settlers 2 map loading is handled together with Widelands map loading in the get_correct_loader function. I might look into how I could refactor that so that WL_Map_Loader doesn't have to delete the pointer in its destructor.
--
https://code.launchpad.net/~csirkeee/widelands/memory-leaks-2/+merge/150290
Your team Widelands Developers is requested to review the proposed merge of lp:~csirkeee/widelands/memory-leaks-2 into lp:widelands.
References