0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

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.
This commit is contained in:
Hennadii Stepanov 2020-03-24 21:16:38 +02:00
parent 5236b2e267
commit 8e08d00598

View file

@ -210,8 +210,6 @@ BitcoinApplication::~BitcoinApplication()
delete window; delete window;
window = nullptr; window = nullptr;
delete optionsModel;
optionsModel = nullptr;
delete platformStyle; delete platformStyle;
platformStyle = nullptr; platformStyle = nullptr;
} }
@ -225,7 +223,7 @@ void BitcoinApplication::createPaymentServer()
void BitcoinApplication::createOptionsModel(bool resetSettings) 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) void BitcoinApplication::createWindow(const NetworkStyle *networkStyle)