aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoin.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-03-24 21:16:38 +0200
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-03-24 22:53:07 +0200
commit8e08d005989c6b5f7f05e0a1e0ba84f544a76d01 (patch)
tree73563bec2d9c96b2f11526554425f267e8afa0b2 /src/qt/bitcoin.cpp
parent5236b2e267a58870239673c7ec85e5df0cb8fc8e (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/bitcoin.cpp')
-rw-r--r--src/qt/bitcoin.cpp4
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)