mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-06-09 15:33:07 -04:00
FDO Secrets: Fix double free on exit
* Prevent double free due to QObject cleanup happening before/after the ExtraPage storing the QSharedPointer to FdoSecretsPlugin is deleted. * Fixes #4877
This commit is contained in:
parent
c46f3d37b1
commit
736df7696f
3 changed files with 14 additions and 3 deletions
|
@ -30,13 +30,21 @@
|
||||||
|
|
||||||
using FdoSecrets::Service;
|
using FdoSecrets::Service;
|
||||||
|
|
||||||
|
// TODO: Only used for testing. Need to split service functions away from settings page.
|
||||||
|
QPointer<FdoSecretsPlugin> g_fdoSecretsPlugin;
|
||||||
|
|
||||||
FdoSecretsPlugin::FdoSecretsPlugin(DatabaseTabWidget* tabWidget)
|
FdoSecretsPlugin::FdoSecretsPlugin(DatabaseTabWidget* tabWidget)
|
||||||
: QObject(tabWidget)
|
: m_dbTabs(tabWidget)
|
||||||
, m_dbTabs(tabWidget)
|
|
||||||
{
|
{
|
||||||
|
g_fdoSecretsPlugin = this;
|
||||||
FdoSecrets::registerDBusTypes();
|
FdoSecrets::registerDBusTypes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FdoSecretsPlugin* FdoSecretsPlugin::getPlugin()
|
||||||
|
{
|
||||||
|
return g_fdoSecretsPlugin;
|
||||||
|
}
|
||||||
|
|
||||||
QWidget* FdoSecretsPlugin::createWidget()
|
QWidget* FdoSecretsPlugin::createWidget()
|
||||||
{
|
{
|
||||||
return new SettingsWidgetFdoSecrets(this);
|
return new SettingsWidgetFdoSecrets(this);
|
||||||
|
|
|
@ -70,6 +70,9 @@ public:
|
||||||
*/
|
*/
|
||||||
QString reportExistingService() const;
|
QString reportExistingService() const;
|
||||||
|
|
||||||
|
// TODO: Only used for testing. Need to split service functions away from settings page.
|
||||||
|
static FdoSecretsPlugin* getPlugin();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void emitRequestSwitchToDatabases();
|
void emitRequestSwitchToDatabases();
|
||||||
void emitRequestShowNotification(const QString& msg, const QString& title = {});
|
void emitRequestShowNotification(const QString& msg, const QString& title = {});
|
||||||
|
|
|
@ -200,7 +200,7 @@ void TestGuiFdoSecrets::initTestCase()
|
||||||
m_mainWindow.reset(new MainWindow());
|
m_mainWindow.reset(new MainWindow());
|
||||||
m_tabWidget = m_mainWindow->findChild<DatabaseTabWidget*>("tabWidget");
|
m_tabWidget = m_mainWindow->findChild<DatabaseTabWidget*>("tabWidget");
|
||||||
QVERIFY(m_tabWidget);
|
QVERIFY(m_tabWidget);
|
||||||
m_plugin = m_mainWindow->findChild<FdoSecretsPlugin*>();
|
m_plugin = FdoSecretsPlugin::getPlugin();
|
||||||
QVERIFY(m_plugin);
|
QVERIFY(m_plugin);
|
||||||
m_mainWindow->show();
|
m_mainWindow->show();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue