Skip to content

Commit f759870

Browse files
committed
Fixed resetConfig() bug
1 parent 6c4258c commit f759870

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

Core/Infrastructure/Configurable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Configurable::setOption(const string &opt, const string &value)
5252
}
5353

5454
void
55-
Configurable::resetConfig(const Defaults &defaults, isize objid)
55+
Configurable::resetConfigItems(const Defaults &defaults, isize objid)
5656
{
5757
for (auto &option : getOptions()) {
5858

Core/Infrastructure/Configurable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Configurable
4545
void setOption(const string &opt, const string &value);
4646

4747
// Resets all config options
48-
void resetConfig(const class Defaults &defaults, isize objid = 0);
48+
virtual void resetConfigItems(const class Defaults &defaults, isize objid = 0);
4949

5050
// Dumps the current configuration
5151
void dumpConfig(std::ostream &os) const;

Core/Infrastructure/CoreComponent.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void
117117
CoreComponent::resetConfig()
118118
{
119119
postorderWalk([this](CoreComponent *c) {
120-
c->Configurable::resetConfig(emulator.defaults, c->objid);
120+
c->resetConfigItems(emulator.defaults, c->objid);
121121
});
122122
}
123123

Core/Infrastructure/Host.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ Host::setOption(Opt opt, i64 value)
7878
}
7979
}
8080

81+
void
82+
Host::resetConfigItems(const class Defaults &defaults, isize objid)
83+
{
84+
// Don't reset any host properties
85+
}
86+
8187
void
8288
Host::_dump(Category category, std::ostream &os) const
8389
{

Core/Infrastructure/Host.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class Host final : public SubComponent {
9191
i64 getOption(Opt opt) const override;
9292
void checkOption(Opt opt, i64 value) override;
9393
void setOption(Opt opt, i64 value) override;
94+
void resetConfigItems(const class Defaults &defaults, isize objid = 0) override;
9495

9596

9697
//

0 commit comments

Comments
 (0)