Skip to content

Commit 8e08d00

Browse files
committed
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.
1 parent 5236b2e commit 8e08d00

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/qt/bitcoin.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,6 @@ BitcoinApplication::~BitcoinApplication()
210210

211211
delete window;
212212
window = nullptr;
213-
delete optionsModel;
214-
optionsModel = nullptr;
215213
delete platformStyle;
216214
platformStyle = nullptr;
217215
}
@@ -225,7 +223,7 @@ void BitcoinApplication::createPaymentServer()
225223

226224
void BitcoinApplication::createOptionsModel(bool resetSettings)
227225
{
228-
optionsModel = new OptionsModel(m_node, nullptr, resetSettings);
226+
optionsModel = new OptionsModel(m_node, this, resetSettings);
229227
}
230228

231229
void BitcoinApplication::createWindow(const NetworkStyle *networkStyle)

0 commit comments

Comments
 (0)