mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-18 19:47:53 +02: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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user