don't allocate config_t within config.cc
This commit is contained in:
parent
cd7d7e5b88
commit
c0d7feac7f
3 changed files with 16 additions and 11 deletions
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
namespace ledger {
|
||||
|
||||
std::auto_ptr<config_t> config(new config_t);
|
||||
config_t * config = NULL;
|
||||
|
||||
const std::string bal_fmt = "%20T %2_%-n\n";
|
||||
const std::string reg_fmt
|
||||
|
|
|
|||
2
config.h
2
config.h
|
|
@ -45,7 +45,7 @@ struct config_t
|
|||
config_t();
|
||||
};
|
||||
|
||||
extern std::auto_ptr<config_t> config;
|
||||
extern config_t * config;
|
||||
|
||||
void option_help(std::ostream& out);
|
||||
|
||||
|
|
|
|||
5
main.cc
5
main.cc
|
|
@ -35,6 +35,11 @@ int main(int argc, char * argv[], char * envp[])
|
|||
{
|
||||
std::auto_ptr<journal_t> journal(new journal_t);
|
||||
|
||||
// Initialize the global configuration object for this run
|
||||
|
||||
std::auto_ptr<config_t> global_config(new config_t);
|
||||
config = global_config.get();
|
||||
|
||||
// Parse command-line arguments
|
||||
|
||||
TIMER_START(process_args);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue