From 8e08d005989c6b5f7f05e0a1e0ba84f544a76d01 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Tue, 24 Mar 2020 21:16:38 +0200 Subject: 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. --- src/qt/bitcoin.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') 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) -- cgit v1.2.3