Skip to content

Commit

Permalink
app_template: fix use after move in app constructor
Browse files Browse the repository at this point in the history
We are referencing cfg attributes but cfg is moved already by then. This
seems to work because the duration type moves are not destructive but it is
still confusing for readers and not a good practice.

Found this by code inspection while searching for something else.

Signed-off-by: Glauber Costa <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
Glauber Costa authored and avikivity committed Feb 19, 2019
1 parent fdc1096 commit 1aacf7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/app-template.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ app_template::app_template(app_template::config cfg)
("help,h", "show help message")
;

_opts_conf_file.add(reactor::get_options_description(cfg.default_task_quota));
_opts_conf_file.add(reactor::get_options_description(_cfg.default_task_quota));
_opts_conf_file.add(seastar::metrics::get_options_description());
_opts_conf_file.add(smp::get_options_description());
_opts_conf_file.add(scollectd::get_options_description());
Expand Down

0 comments on commit 1aacf7d

Please sign in to comment.