Skip to content

Commit e7e89c3

Browse files
committed
fixed:sqlite Incorrent in sqlite
1 parent e790b28 commit e7e89c3

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

XEngine_Source/XEngine_StorageComponents/XStorage_SQLPacket/SQLPacket_Define.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#pragma once
1+
#pragma once
22
/********************************************************************
33
// Created: 2019/6/28 14:56
44
// Filename: E:\NetEngine_Windows\NetEngine_SourceCode\NetEngine_Storage\NetEngine_XStorageCore\XStorageCore_Define.h

XEngine_Source/XEngine_StorageComponents/XStorage_SQLPacket/XStorage_SQLite/XStorage_SQLite.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ CXStorage_SQLite::~CXStorage_SQLite()
4444
BOOL CXStorage_SQLite::XStorage_SQLite_Init(LPCTSTR lpszSQLFile, int nTimeMonth /* = 1 */)
4545
{
4646
XStorage_IsErrorOccur = FALSE;
47-
4847
//创建数据库
4948
if (!DataBase_SQLite_Create(lpszSQLFile))
5049
{
@@ -66,7 +65,8 @@ BOOL CXStorage_SQLite::XStorage_SQLite_Init(LPCTSTR lpszSQLFile, int nTimeMonth
6665
bIsRun = TRUE;
6766
m_nTimeMonth = nTimeMonth;
6867

69-
pSTDThread = make_shared<std::thread>(XStorage_SQLite_Thread, this);
68+
pSTDThread = new std::thread(XStorage_SQLite_Thread, this);
69+
//pSTDThread = make_shared<std::thread>(XStorage_SQLite_Thread, this);
7070
if (!pSTDThread->joinable())
7171
{
7272
XStorage_IsErrorOccur = TRUE;
@@ -93,6 +93,7 @@ BOOL CXStorage_SQLite::XStorage_SQLite_Destory()
9393
}
9494
bIsRun = FALSE;
9595
pSTDThread->join();
96+
delete pSTDThread;
9697
DataBase_SQLite_Close(xhSQL);
9798
return TRUE;
9899
}

XEngine_Source/XEngine_StorageComponents/XStorage_SQLPacket/XStorage_SQLite/XStorage_SQLite.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
#pragma once
1+
#pragma once
22
/********************************************************************
33
// Created: 2021/07/12 09:31:03
44
// File Name: D:\XEngine_Storage\XEngine_Source\XEngine_StorageComponents\XStorage_SQLPacket\XStorage_SQLite\XStorage_SQLite.h
55
// File Path: D:\XEngine_Storage\XEngine_Source\XEngine_StorageComponents\XStorage_SQLPacket\XStorage_SQLite
66
// File Base: XStorage_SQLite
77
// File Ext: h
8-
// Project: XEngine(ÍøÂçͨÐÅÒýÇæ)
8+
// Project: XEngine(网络通信引擎)
99
// Author: qyt
10-
// Purpose: SQLITE²Ù×÷Àà
10+
// Purpose: SQLITE操作类
1111
// History:
1212
*********************************************************************/
1313

@@ -36,5 +36,6 @@ class CXStorage_SQLite
3636
int m_nTimeMonth;
3737
XHDATA xhSQL;
3838
private:
39-
shared_ptr<std::thread> pSTDThread;
39+
std::thread* pSTDThread;
40+
//shared_ptr<std::thread> pSTDThread; don't know incorrent in linux.
4041
};

0 commit comments

Comments
 (0)