Skip to content

Commit aac8b2a

Browse files
fixup! Make parse_options_baset the owner of message_handler
1 parent d2baea5 commit aac8b2a

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/util/parse_options.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ parse_options_baset::parse_options_baset(
2929
int argc,
3030
const char **argv,
3131
const std::string &program)
32+
: parse_result(
33+
cmdline.parse(argc, argv, (std::string("?h(help)")+_optstring).c_str())),
34+
message_handler(cmdline, program),
35+
log(message_handler)
3236
{
33-
std::string optstring=std::string("?h(help)")+_optstring;
34-
parse_result=cmdline.parse(argc, argv, optstring.c_str());
35-
message_handler = util_make_unique<ui_message_handlert>(cmdline, program);
36-
log = messaget{*message_handler};
3737
}
3838

3939
void parse_options_baset::help()

src/util/parse_options.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,15 @@ class parse_options_baset
3636
virtual int main();
3737
virtual ~parse_options_baset() { }
3838

39+
private:
40+
bool parse_result;
41+
3942
protected:
40-
std::unique_ptr<ui_message_handlert> message_handler;
43+
ui_message_handlert message_handler;
4144
messaget log;
4245

4346
private:
4447
void unknown_option_msg();
45-
bool parse_result;
4648
};
4749

4850
std::string

0 commit comments

Comments
 (0)