← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~aber/widelands/newAndDelete into lp:widelands

 

David Allwicher has proposed merging lp:~aber/widelands/newAndDelete into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~aber/widelands/newAndDelete/+merge/102147

Don't you need to call delete, if you use new? Maybe it's black magic, maybe c++ is in fact black magic. So, please have a look and let me know :)
-- 
https://code.launchpad.net/~aber/widelands/newAndDelete/+merge/102147
Your team Widelands Developers is requested to review the proposed merge of lp:~aber/widelands/newAndDelete into lp:widelands.
=== modified file 'src/wui/mapview.cc'
--- src/wui/mapview.cc	2012-02-23 21:54:25 +0000
+++ src/wui/mapview.cc	2012-04-16 17:22:24 +0000
@@ -101,11 +101,12 @@
 	} else {
 		gameview = new GameViewSDL(dst);
 	}
-
-	if (upcast(Interactive_Player const, interactive_player, &intbase()))
+	if (upcast(Interactive_Player const, interactive_player, &intbase())) {
 		gameview->rendermap(egbase, interactive_player->player(), m_viewpoint);
-	else
+	} else {
 		gameview->rendermap(egbase, m_viewpoint);
+	}
+	delete gameview;
 
 	m_complete_redraw_needed = false;
 	if (char const * const text = tooltip())


Follow ups