diff options
Diffstat (limited to 'source/fud_sqlite.cpp')
-rw-r--r-- | source/fud_sqlite.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/source/fud_sqlite.cpp b/source/fud_sqlite.cpp index 7ad8a12..f573f1c 100644 --- a/source/fud_sqlite.cpp +++ b/source/fud_sqlite.cpp @@ -49,6 +49,11 @@ SqliteDb::~SqliteDb() SqliteDb& SqliteDb::operator=(SqliteDb&& rhs) { + if (m_dbHandle != nullptr) { + sqlite3_close(m_dbHandle); + m_dbHandle = nullptr; + } + m_name = std::move(rhs.m_name); m_nameValid = rhs.m_nameValid; m_dbHandle = rhs.m_dbHandle; @@ -162,21 +167,6 @@ SqliteStatement::SqliteStatement(SqliteStatement&& rhs) : rhs.m_preparedStatement = nullptr; } -SqliteStatement& SqliteStatement::operator=(SqliteStatement&& rhs) -{ - m_input = std::move(rhs.m_input); - m_tail = rhs.m_tail; - m_status = rhs.m_status; - m_errorCode = rhs.m_errorCode; - m_preparedStatement = rhs.m_preparedStatement; - - rhs.m_tail = nullptr; - rhs.m_status = FudStatus::ObjectInvalid; - rhs.m_preparedStatement = nullptr; - - return *this; -} - SqliteStatement::~SqliteStatement() { if (m_preparedStatement != nullptr) { |