octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

QSettings deleted by singleton-cleanup mechanism


From: Daniel J Sebald
Subject: QSettings deleted by singleton-cleanup mechanism
Date: Wed, 17 Jun 2015 14:43:53 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

Currently the GUI's QSettings are instantiated and deleted by the Octave worker thread using the singleton-cleanup mechanism. Can that be changed? Was there a reason to have the worker, which is in another thread, do this?

According to the Qt documentation:

http://doc.qt.io/qt-4.8/qsettings.html#sync

the QSettings are periodically saved and saved when the object is deleted. It seems to me rather straightforward for the main window to create a QSettings object when it is created. The QSettings will be automatically deleted when the main window is deleted and consequently save the settings to permanent storage then. Or, another approach would be to create a QSettings locally, save any changes in the QSettings and delete the QSettings locally.

The problem with having some other thread save the settings is if that thread is interrupted abruptly (say with a force close, which I'm trying to fix at the moment), it can remove the QSettings or incompletely save settings.

Dan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]