diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-09 01:20:48 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-03-09 01:20:48 +0000 |
commit | 78ab0ec914d3c5a97f162905afb3dede53f8b9ed (patch) | |
tree | 53e386c28d5621535c76c35c20f28b7dd6235ee3 /src/gui/trade.cpp | |
parent | 3bd2abeeffe9fb9b23293975b159ee2ddc868e5b (diff) | |
download | mana-78ab0ec914d3c5a97f162905afb3dede53f8b9ed.tar.gz mana-78ab0ec914d3c5a97f162905afb3dede53f8b9ed.tar.bz2 mana-78ab0ec914d3c5a97f162905afb3dede53f8b9ed.tar.xz mana-78ab0ec914d3c5a97f162905afb3dede53f8b9ed.zip |
Use std::auto_ptr in some places.
Diffstat (limited to 'src/gui/trade.cpp')
-rw-r--r-- | src/gui/trade.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp index f7286fd2..9d10774b 100644 --- a/src/gui/trade.cpp +++ b/src/gui/trade.cpp @@ -45,7 +45,9 @@ TradeWindow::TradeWindow(Network *network): Window("Trade: You"), - mNetwork(network) + mNetwork(network), + myInventory(new Inventory()), + partnerInventory(new Inventory()) { setContentSize(322, 150); @@ -54,16 +56,13 @@ TradeWindow::TradeWindow(Network *network): cancelButton = new Button("Cancel"); tradeButton = new Button("Trade"); - myInventory = new Inventory(); - partnerInventory = new Inventory(); - - myItemContainer = new ItemContainer(myInventory); + myItemContainer = new ItemContainer(myInventory.get()); myItemContainer->setPosition(2, 2); myScroll = new ScrollArea(myItemContainer); myScroll->setPosition(8, 8); - partnerItemContainer = new ItemContainer(partnerInventory); + partnerItemContainer = new ItemContainer(partnerInventory.get()); partnerItemContainer->setPosition(2, 58); partnerScroll = new ScrollArea(partnerItemContainer); @@ -137,8 +136,6 @@ TradeWindow::TradeWindow(Network *network): TradeWindow::~TradeWindow() { - delete myInventory; - delete partnerInventory; } void TradeWindow::addMoney(int amount) |