mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-02 19:52:01 +02:00
Merge #18424: qt: Use parent-child relation to manage lifetime of OptionsModel object
8e08d00598
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:5236b2e267/src/qt/optionsmodel.cpp (L29-L30)
This PR does not change behavior. ACKs for top commit: jonasschnelli: utACK8e08d00598
promag: ACK8e08d00598
. Tree-SHA512: 0223dddf5ba28b0bfaefeda1b03b4ff95bf7e7d0c1e7b32368171e561813e22129f2a664f09279fa3b4fa63259b7680d55aa3fe66db9c7ae0039b7f529777ec3
This commit is contained in:
@ -212,8 +212,6 @@ BitcoinApplication::~BitcoinApplication()
|
|||||||
|
|
||||||
delete window;
|
delete window;
|
||||||
window = nullptr;
|
window = nullptr;
|
||||||
delete optionsModel;
|
|
||||||
optionsModel = nullptr;
|
|
||||||
delete platformStyle;
|
delete platformStyle;
|
||||||
platformStyle = nullptr;
|
platformStyle = nullptr;
|
||||||
}
|
}
|
||||||
@ -227,7 +225,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)
|
||||||
|
Reference in New Issue
Block a user