diff options
| author | Hennadii Stepanov <[email protected]> | 2020-03-24 21:16:38 +0200 |
|---|---|---|
| committer | Hennadii Stepanov <[email protected]> | 2020-03-24 22:53:07 +0200 |
| commit | 8e08d005989c6b5f7f05e0a1e0ba84f544a76d01 (patch) | |
| tree | 73563bec2d9c96b2f11526554425f267e8afa0b2 /src/qt/bitcoin.cpp | |
| parent | Merge #18417: tests: Add fuzzing harnesses for functions in addrdb.h, net_per... (diff) | |
| download | discoin-8e08d005989c6b5f7f05e0a1e0ba84f544a76d01.tar.xz discoin-8e08d005989c6b5f7f05e0a1e0ba84f544a76d01.zip | |
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.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 4313d6ee7..5a662af25 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) |