mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-22 10:44:46 +00:00
Shutdown daemon and close wallet properly on app exit
This commit is contained in:
parent
7876957b48
commit
8dfa79ec58
2 changed files with 16 additions and 7 deletions
8
main.cpp
8
main.cpp
|
@ -31,6 +31,7 @@
|
||||||
#include <QtQml>
|
#include <QtQml>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QObject>
|
||||||
#include "clipboardAdapter.h"
|
#include "clipboardAdapter.h"
|
||||||
#include "filter.h"
|
#include "filter.h"
|
||||||
#include "oscursor.h"
|
#include "oscursor.h"
|
||||||
|
@ -110,6 +111,13 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
engine.rootContext()->setContextProperty("daemonManager", DaemonManager::instance(QCoreApplication::arguments()));
|
engine.rootContext()->setContextProperty("daemonManager", DaemonManager::instance(QCoreApplication::arguments()));
|
||||||
|
|
||||||
|
DaemonManager * daemonManager = DaemonManager::instance(QCoreApplication::arguments());
|
||||||
|
QObject::connect(&app, SIGNAL(aboutToQuit()), daemonManager, SLOT(closing()));
|
||||||
|
engine.rootContext()->setContextProperty("daemonManager", daemonManager);
|
||||||
|
|
||||||
|
|
||||||
|
>>>>>>> cc05e1a... Shutdown daemon and close wallet properly on app exit
|
||||||
|
|
||||||
// export to QML monero accounts root directory
|
// export to QML monero accounts root directory
|
||||||
// wizard is talking about where
|
// wizard is talking about where
|
||||||
// to save the wallet file (.keys, .bin), they have to be user-accessible for
|
// to save the wallet file (.keys, .bin), they have to be user-accessible for
|
||||||
|
|
15
main.qml
15
main.qml
|
@ -1053,12 +1053,13 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClosing: {
|
onClosing: {
|
||||||
// Close and save to disk on app close
|
// Make sure wallet is closed before app exit (~Wallet() isn't always invoked)
|
||||||
if (currentWallet != undefined) {
|
// Daemon shutdown is handled with signal/slot in main.cpp
|
||||||
walletManager.closeWallet(currentWallet);
|
if (currentWallet != undefined) {
|
||||||
currentWallet = undefined
|
walletManager.closeWallet(currentWallet);
|
||||||
}
|
currentWallet = undefined
|
||||||
// Stop daemon
|
}
|
||||||
daemonManager.stop();
|
// Stop daemon
|
||||||
|
daemonManager.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue