- Timestamp:
- 05/04/2009 08:56:21 AM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
-
MainFrame.cpp (modified) (6 diffs)
-
MainFrame.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/MainFrame.cpp
r199 r200 94 94 std::string config_file_str; 95 95 config_file_str = config_file.utf8_str(); 96 m_config = new configuration::Configuration(config_file_str);97 m_stats = new statistics::Statistics(m_config);96 m_config.reset(new configuration::Configuration(config_file_str)); 97 m_stats.reset(new statistics::Statistics(m_config.get())); 98 98 99 99 m_evt_handler = new MainFrameEvtHandler(this); … … 521 521 void MainFrame::OnShowHighscore(wxCommandEvent& event) 522 522 { 523 highscores_dialog::HighscoresDialog *dialog = new highscores_dialog::HighscoresDialog(this, m_config);523 highscores_dialog::HighscoresDialog *dialog = new highscores_dialog::HighscoresDialog(this, m_config.get()); 524 524 525 525 dialog->ShowModal(); … … 530 530 void MainFrame::OnStatistics(wxCommandEvent &event) 531 531 { 532 statistics_dialog::StatisticsDialog *dialog = new statistics_dialog::StatisticsDialog(this, m_stats );532 statistics_dialog::StatisticsDialog *dialog = new statistics_dialog::StatisticsDialog(this, m_stats.get()); 533 533 dialog->ShowModal(); 534 534 delete dialog; … … 542 542 void MainFrame::OnSettings( wxCommandEvent& event) 543 543 { 544 settings_dialog::SettingsDialog* settings_dialog = new settings_dialog::SettingsDialog(this, m_config );544 settings_dialog::SettingsDialog* settings_dialog = new settings_dialog::SettingsDialog(this, m_config.get()); 545 545 546 546 if (settings_dialog->ShowModal()!=wxID_OK) { … … 1032 1032 1033 1033 //now show the high score table 1034 highscores_dialog::HighscoresDialog *dialog = new highscores_dialog::HighscoresDialog(this, m_config,rank);1034 highscores_dialog::HighscoresDialog *dialog = new highscores_dialog::HighscoresDialog(this, m_config.get(),rank); 1035 1035 1036 1036 dialog->ShowModal(); … … 1355 1355 MainFrame::~MainFrame() { 1356 1356 // free pointers 1357 delete m_stats;1358 delete m_config;1359 1357 delete m_evt_handler; 1360 1358 -
trunk/src/MainFrame.h
r199 r200 27 27 #ifndef OPENYAHTZEE_MAIN_FRAME_INC 28 28 #define OPENYAHTZEE_MAIN_FRAME_INC 29 #include <memory> 30 #include <boost/scoped_ptr.hpp> 29 31 #include "ScoreDice.h" 30 32 #include "configuration.h" … … 82 84 ScoreDice m_score_dice; 83 85 84 configuration::Configuration *m_config;85 statistics::Statistics *m_stats;86 boost::scoped_ptr<configuration::Configuration> m_config; 87 boost::scoped_ptr<statistics::Statistics> m_stats; 86 88 87 89 private:
Note: See TracChangeset
for help on using the changeset viewer.
