Merge PR #489: Do not call functions in paused plugins
This should be reverted when pausing is removed, see PR discussion.
This commit is contained in:
commit
215599b90f
@ -252,6 +252,9 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
|
|||||||
if (filter)
|
if (filter)
|
||||||
filter->Preprocess(func, temp_info);
|
filter->Preprocess(func, temp_info);
|
||||||
|
|
||||||
|
if (func->GetParentRuntime()->IsPaused())
|
||||||
|
continue;
|
||||||
|
|
||||||
for (unsigned int i=0; i<num_params; i++)
|
for (unsigned int i=0; i<num_params; i++)
|
||||||
{
|
{
|
||||||
int err = SP_ERROR_PARAM;
|
int err = SP_ERROR_PARAM;
|
||||||
|
@ -237,6 +237,9 @@ public:
|
|||||||
}
|
}
|
||||||
void CancelThinkPart()
|
void CancelThinkPart()
|
||||||
{
|
{
|
||||||
|
if (!m_pFunction->IsRunnable())
|
||||||
|
return;
|
||||||
|
|
||||||
m_pFunction->PushCell(BAD_HANDLE);
|
m_pFunction->PushCell(BAD_HANDLE);
|
||||||
m_pFunction->PushCell(BAD_HANDLE);
|
m_pFunction->PushCell(BAD_HANDLE);
|
||||||
m_pFunction->PushString("Driver is unloading");
|
m_pFunction->PushString("Driver is unloading");
|
||||||
@ -267,11 +270,14 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_pFunction->IsRunnable())
|
||||||
|
{
|
||||||
m_pFunction->PushCell(m_MyHandle);
|
m_pFunction->PushCell(m_MyHandle);
|
||||||
m_pFunction->PushCell(qh);
|
m_pFunction->PushCell(qh);
|
||||||
m_pFunction->PushString(qh == BAD_HANDLE ? error : "");
|
m_pFunction->PushString(qh == BAD_HANDLE ? error : "");
|
||||||
m_pFunction->PushCell(m_Data);
|
m_pFunction->PushCell(m_Data);
|
||||||
m_pFunction->Execute(NULL);
|
m_pFunction->Execute(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
if (qh != BAD_HANDLE)
|
if (qh != BAD_HANDLE)
|
||||||
{
|
{
|
||||||
@ -335,9 +341,11 @@ public:
|
|||||||
void CancelThinkPart()
|
void CancelThinkPart()
|
||||||
{
|
{
|
||||||
if (m_pDatabase)
|
if (m_pDatabase)
|
||||||
{
|
|
||||||
m_pDatabase->Close();
|
m_pDatabase->Close();
|
||||||
}
|
|
||||||
|
if (!m_pFunction->IsRunnable())
|
||||||
|
return;
|
||||||
|
|
||||||
if (m_ACM == ACM_Old)
|
if (m_ACM == ACM_Old)
|
||||||
m_pFunction->PushCell(BAD_HANDLE);
|
m_pFunction->PushCell(BAD_HANDLE);
|
||||||
m_pFunction->PushCell(BAD_HANDLE);
|
m_pFunction->PushCell(BAD_HANDLE);
|
||||||
@ -349,6 +357,13 @@ public:
|
|||||||
{
|
{
|
||||||
Handle_t hndl = BAD_HANDLE;
|
Handle_t hndl = BAD_HANDLE;
|
||||||
|
|
||||||
|
if (!m_pFunction->IsRunnable())
|
||||||
|
{
|
||||||
|
if (m_pDatabase)
|
||||||
|
m_pDatabase->Close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_pDatabase)
|
if (m_pDatabase)
|
||||||
{
|
{
|
||||||
if ((hndl = g_DBMan.CreateHandle(DBHandle_Database, m_pDatabase, me->GetIdentity()))
|
if ((hndl = g_DBMan.CreateHandle(DBHandle_Database, m_pDatabase, me->GetIdentity()))
|
||||||
@ -1678,12 +1693,15 @@ private:
|
|||||||
data[i] = txn_->entries[i].data;
|
data[i] = txn_->entries[i].data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (success_->IsRunnable())
|
||||||
|
{
|
||||||
success_->PushCell(dbh);
|
success_->PushCell(dbh);
|
||||||
success_->PushCell(data_);
|
success_->PushCell(data_);
|
||||||
success_->PushCell(txn_->entries.length());
|
success_->PushCell(txn_->entries.length());
|
||||||
success_->PushArray(handles.get(), results_.length());
|
success_->PushArray(handles.get(), results_.length());
|
||||||
success_->PushArray(data.get(), results_.length());
|
success_->PushArray(data.get(), results_.length());
|
||||||
success_->Execute(NULL);
|
success_->Execute(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
// Cleanup. Note we clear results_, since freeing their handles will
|
// Cleanup. Note we clear results_, since freeing their handles will
|
||||||
// call Destroy(), and we don't want to double-free in ~TTransactOp.
|
// call Destroy(), and we don't want to double-free in ~TTransactOp.
|
||||||
@ -1722,6 +1740,8 @@ public:
|
|||||||
db_->AddRef();
|
db_->AddRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (failure_->IsRunnable())
|
||||||
|
{
|
||||||
failure_->PushCell(dbh);
|
failure_->PushCell(dbh);
|
||||||
failure_->PushCell(data_);
|
failure_->PushCell(data_);
|
||||||
failure_->PushCell(txn_->entries.length());
|
failure_->PushCell(txn_->entries.length());
|
||||||
@ -1729,6 +1749,7 @@ public:
|
|||||||
failure_->PushCell(failIndex_);
|
failure_->PushCell(failIndex_);
|
||||||
failure_->PushArray(data.get(), txn_->entries.length());
|
failure_->PushArray(data.get(), txn_->entries.length());
|
||||||
failure_->Execute(NULL);
|
failure_->Execute(NULL);
|
||||||
|
}
|
||||||
|
|
||||||
handlesys->FreeHandle(dbh, &sec);
|
handlesys->FreeHandle(dbh, &sec);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user