diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-03-24 21:16:38 +0200 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2020-03-24 22:53:07 +0200 |
commit | 8e08d005989c6b5f7f05e0a1e0ba84f544a76d01 (patch) | |
tree | 73563bec2d9c96b2f11526554425f267e8afa0b2 /src/qt | |
parent | 5236b2e267a58870239673c7ec85e5df0cb8fc8e (diff) |
qt: Use parent-child relation to manage lifetime of OptionsModel object
Both BitcoinApplication and OptionsModel classes are derived from the
QObject class, therefore a parent-child relation could be established to
manage the lifetime of an OptionsModel object.
This commit does not change behavior.
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/bitcoin.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 4313d6ee7f..5a662af25f 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -210,8 +210,6 @@ BitcoinApplication::~BitcoinApplication() delete window; window = nullptr; - delete optionsModel; - optionsModel = nullptr; delete platformStyle; platformStyle = nullptr; } @@ -225,7 +223,7 @@ void BitcoinApplication::createPaymentServer() void BitcoinApplication::createOptionsModel(bool resetSettings) { - optionsModel = new OptionsModel(m_node, nullptr, resetSettings); + optionsModel = new OptionsModel(m_node, this, resetSettings); } void BitcoinApplication::createWindow(const NetworkStyle *networkStyle) |