Skip to content

Commit

Permalink
Added virtual destructors to OptionsPanel option types.
Browse files Browse the repository at this point in the history
This should fix the crash bug when leaving the options menu on macOS.
  • Loading branch information
afritz1 committed Sep 19, 2018
1 parent 8cd32a0 commit 96252c5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OpenTESArena/src/Interface/OptionsPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class OptionsPanel : public Panel
public:
Option(const std::string &name, std::string &&tooltip, Type type);
Option(const std::string &name, Type type);
virtual ~Option() = default;

const std::string &getName() const;
const std::string &getTooltip() const;
Expand All @@ -53,6 +54,7 @@ class OptionsPanel : public Panel
BoolOption(const std::string &name, std::string &&tooltip, bool value,
Callback &&callback);
BoolOption(const std::string &name, bool value, Callback &&callback);
virtual ~BoolOption() = default;

virtual std::string getDisplayedValue() const override;

Expand All @@ -72,6 +74,7 @@ class OptionsPanel : public Panel
int min, int max, Callback &&callback);
IntOption(const std::string &name, int value, int delta, int min, int max,
Callback &&callback);
virtual ~IntOption() = default;

int getNext() const; // Adds delta to current value, clamped between [min, max].
int getPrev() const; // Subtracts delta from current value, clamped between [min, max].
Expand All @@ -94,6 +97,7 @@ class OptionsPanel : public Panel
double min, double max, int precision, Callback &&callback);
DoubleOption(const std::string &name, double value, double delta, double min,
double max, int precision, Callback &&callback);
virtual ~DoubleOption() = default;

double getNext() const; // Adds delta to current value, clamped between [min, max].
double getPrev() const; // Subtracts delta from current value, clamped between [min, max].
Expand All @@ -113,6 +117,7 @@ class OptionsPanel : public Panel
StringOption(const std::string &name, std::string &&tooltip, std::string &&value,
Callback &&callback);
StringOption(const std::string &name, std::string &&value, Callback &&callback);
virtual ~StringOption() = default;

virtual std::string getDisplayedValue() const override;

Expand Down

0 comments on commit 96252c5

Please sign in to comment.