diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2020-05-29 11:09:05 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2020-05-29 11:09:09 +0200 |
commit | d7f5e01e30938c586c3279c91914add94eeb239c (patch) | |
tree | d4a34c0ac74be61cf2d6cce38fdeb44f9b356e45 /src/qt/bitcoin.cpp | |
parent | de369c7ea57745fbbbab5c7ba3ec8ab48f9e3ec5 (diff) | |
parent | 8e08d005989c6b5f7f05e0a1e0ba84f544a76d01 (diff) |
Merge #18424: qt: Use parent-child relation to manage lifetime of OptionsModel object
8e08d005989c6b5f7f05e0a1e0ba84f544a76d01 qt: Use parent-child relation to manage lifetime of OptionsModel object (Hennadii Stepanov)
Pull request description:
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:
https://github.com/bitcoin/bitcoin/blob/5236b2e267a58870239673c7ec85e5df0cb8fc8e/src/qt/optionsmodel.cpp#L29-L30
This PR does not change behavior.
ACKs for top commit:
jonasschnelli:
utACK 8e08d005989c6b5f7f05e0a1e0ba84f544a76d01
promag:
ACK 8e08d005989c6b5f7f05e0a1e0ba84f544a76d01.
Tree-SHA512: 0223dddf5ba28b0bfaefeda1b03b4ff95bf7e7d0c1e7b32368171e561813e22129f2a664f09279fa3b4fa63259b7680d55aa3fe66db9c7ae0039b7f529777ec3
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 6fdf6322ff..ad74ca3a02 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -212,8 +212,6 @@ BitcoinApplication::~BitcoinApplication() delete window; window = nullptr; - delete optionsModel; - optionsModel = nullptr; delete platformStyle; platformStyle = nullptr; } @@ -227,7 +225,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) |