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:
parent
5236b2e267
commit
8e08d00598
1 changed files with 1 additions and 3 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Reference in a new issue