Author: dfranke
Date: Thu Apr 9 08:48:43 2009
New Revision: 34644
URL: http://svn.gna.org/viewcvs/wesnoth?rev=34644&view=rev
Log:
Fix a small memory leak of an end_level_exception.
Modified:
trunk/src/playcampaign.cpp
Modified: trunk/src/playcampaign.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playcampaign.cpp?rev=34644&r1=34643&r2=34644&view=diff
==============================================================================
--- trunk/src/playcampaign.cpp (original)
+++ trunk/src/playcampaign.cpp Thu Apr 9 08:48:43 2009
@@ -308,7 +308,7 @@
bool save_game_after_scenario = true;
LEVEL_RESULT res = VICTORY;
- end_level_exception *end_level = new
end_level_exception(VICTORY);
+ end_level_exception end_level(VICTORY);
try {
// Preserve old label eg. replay
@@ -360,11 +360,11 @@
switch (io_type){
case IO_NONE:
- res =
playsingle_scenario(game_config,scenario,disp,gamestate,story,log, skip_replay,
end_level);
+ res =
playsingle_scenario(game_config,scenario,disp,gamestate,story,log, skip_replay,
&end_level);
break;
case IO_SERVER:
case IO_CLIENT:
- res =
playmp_scenario(game_config,scenario,disp,gamestate,story,log, skip_replay,
io_type, end_level);
+ res =
playmp_scenario(game_config,scenario,disp,gamestate,story,log, skip_replay,
io_type, &end_level);
break;
}
} catch(game::load_game_failed& e) {
@@ -426,7 +426,7 @@
// Continue without saving is like a victory,
// but the save game dialog isn't displayed
- if(!end_level->save)
+ if(!end_level.save)
save_game_after_scenario = false;
// Switch to the next scenario.
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits