mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug 797906 - GnuCash data file is locked after a "save-as"...
to mysql database. It's more general, any save-as to a different backend type, i.e. xml->sql or sql->xml, left the previous book locked. Ensure that the session is ended and the book unlocked in the backend's destructor. This also fixes a memory leak in the SQL backend because the GncSqlConnection wasn't being deleted.
This commit is contained in:
@@ -49,6 +49,11 @@ extern "C"
|
||||
#define FILE_URI_PREFIX "file://"
|
||||
static QofLogModule log_module = GNC_MOD_BACKEND;
|
||||
|
||||
GncXmlBackend::~GncXmlBackend()
|
||||
{
|
||||
session_end();
|
||||
};
|
||||
|
||||
bool
|
||||
GncXmlBackend::check_path (const char* fullpath, bool create)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
GncXmlBackend operator=(const GncXmlBackend&) = delete;
|
||||
GncXmlBackend(const GncXmlBackend&&) = delete;
|
||||
GncXmlBackend operator=(const GncXmlBackend&&) = delete;
|
||||
~GncXmlBackend() = default;
|
||||
~GncXmlBackend();
|
||||
void session_begin(QofSession* session, const char* new_uri,
|
||||
SessionOpenMode mode) override;
|
||||
void session_end() override;
|
||||
|
||||
Reference in New Issue
Block a user