Memory leak in economy/economy.cc split

Bug #1631738 reported by Hans Joachim Desserud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Low
Unassigned

Bug Description

Hi, I just ran scan-build 3.9 on r8131. The majority of reported memory leaks were the usual boost::bind, but this one also showed up.

Still present in r8227.

Related branches

Revision history for this message
Hans Joachim Desserud (hjd) wrote :
Revision history for this message
GunChleoc (gunchleoc) wrote :

The Economy constructor adds the economy to a vector owned by Player and the memory is managed in that class. So, I think we should be fine here.

We could change the design a bit though: Instead of calling the Economy constructor and player.add_economy(*this); inside the Economy constructor, we could shift constructing the Economy object to the player.add_economy function. IMO this would make the control flow clearer.

tags: added: lowhangingfruit
Changed in widelands:
status: New → Confirmed
importance: Undecided → Low
description: updated
GunChleoc (gunchleoc)
Changed in widelands:
status: Confirmed → In Progress
assignee: nobody → GunChleoc (gunchleoc)
milestone: none → build20-rc1
GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Fix Committed
assignee: GunChleoc (gunchleoc) → nobody
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build20-rc1

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.