1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-18 19:47:15 +01:00

Initialize the handle during SQLite connection if one does not exist.

This commit is contained in:
Sandu Liviu Catalin 2016-06-17 07:21:04 +03:00
parent 24eddb8051
commit e07809cb25

View File

@ -104,6 +104,11 @@ const ConnRef & Connection::GetOpened() const
// ------------------------------------------------------------------------------------------------
void Connection::Open(CSStr name)
{
// Should we create a connection handle?
if (!m_Handle)
{
m_Handle = ConnRef(new ConnHnd());
}
// Make sure another database isn't opened
if (GET_VALID_HND(*this)->mPtr != nullptr)
{
@ -116,6 +121,11 @@ void Connection::Open(CSStr name)
// ------------------------------------------------------------------------------------------------
void Connection::Open(CSStr name, Int32 flags)
{
// Should we create a connection handle?
if (!m_Handle)
{
m_Handle = ConnRef(new ConnHnd());
}
// Make sure another database isn't opened
if (GET_VALID_HND(*this)->mPtr != nullptr)
{
@ -128,6 +138,11 @@ void Connection::Open(CSStr name, Int32 flags)
// ------------------------------------------------------------------------------------------------
void Connection::Open(CSStr name, Int32 flags, CSStr vfs)
{
// Should we create a connection handle?
if (!m_Handle)
{
m_Handle = ConnRef(new ConnHnd());
}
// Make sure another database isn't opened
if (GET_VALID_HND(*this)->mPtr != nullptr)
{