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 committed 2020-03-24 22:53:07 +02:00
1 parent 5236b2e267
commit 8e08d00598
1 file changed
+1 -3
+1 -3
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)