mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 13:55:36 +03:00
Fixed threaded queries not having an IQuery assignment
This commit is contained in:
parent
1f0778b14e
commit
57160763af
@ -377,7 +377,8 @@ static cell AMX_NATIVE_CALL SQL_FieldNumToName(AMX *amx, cell *params)
|
||||
static cell AMX_NATIVE_CALL SQL_GetQueryString(AMX *amx, cell *params)
|
||||
{
|
||||
AmxQueryInfo *qInfo = (AmxQueryInfo *)GetHandle(params[1], Handle_Query);
|
||||
if (!qInfo)
|
||||
|
||||
if (!qInfo || !qInfo->pQuery)
|
||||
{
|
||||
MF_LogError(amx, AMX_ERR_NATIVE, "Invalid query handle: %d", params[1]);
|
||||
return 0;
|
||||
|
@ -172,15 +172,13 @@ void MysqlThread::RunThread(IThreadHandle *pHandle)
|
||||
if (m_qrInfo.query_success && m_qrInfo.amxinfo.info.rs)
|
||||
{
|
||||
m_atomicResult.CopyFrom(m_qrInfo.amxinfo.info.rs);
|
||||
m_qrInfo.amxinfo.pQuery = NULL;
|
||||
m_qrInfo.amxinfo.pQuery = pQuery;
|
||||
m_qrInfo.amxinfo.info.rs = &m_atomicResult;
|
||||
}
|
||||
|
||||
if (pQuery)
|
||||
{
|
||||
} else {
|
||||
pQuery->FreeHandle();
|
||||
pQuery = NULL;
|
||||
}
|
||||
|
||||
if (pDatabase)
|
||||
{
|
||||
pDatabase->FreeHandle();
|
||||
@ -248,6 +246,11 @@ void MysqlThread::Execute()
|
||||
(cell)0,
|
||||
data_addr,
|
||||
m_datalen);
|
||||
/* this should always be true I think */
|
||||
if (m_qrInfo.amxinfo.pQuery)
|
||||
{
|
||||
m_qrInfo.amxinfo.pQuery->FreeHandle();
|
||||
}
|
||||
FreeHandle(hndl);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user