fixed amb893, closing a timer handle wouldn't kill the timer properly

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401403
This commit is contained in:
Borja Ferrer 2007-09-03 18:49:58 +00:00
parent 7a02c6b9c2
commit 20350108ac
2 changed files with 7 additions and 3 deletions

View File

@ -82,7 +82,9 @@ TimerNatives::~TimerNatives()
void TimerNatives::OnSourceModAllInitialized()
{
HandleAccess sec;
sec.access[HandleAccess_Clone] |= HANDLE_RESTRICT_IDENTITY;
g_HandleSys.InitAccessDefaults(NULL, &sec);
sec.access[HandleAccess_Clone] = HANDLE_RESTRICT_IDENTITY;
g_TimerType = g_HandleSys.CreateType("Timer", this, 0, NULL, &sec, g_pCoreIdent, NULL);
}
@ -230,7 +232,7 @@ static cell_t smn_TriggerTimer(IPluginContext *pCtx, const cell_t *params)
HandleSecurity sec;
TimerInfo *pInfo;
sec.pOwner = NULL;
sec.pOwner = pCtx->GetIdentity();
sec.pIdentity = g_pCoreIdent;
if ((herr=g_HandleSys.ReadHandle(hndl, g_TimerType, &sec, (void **)&pInfo))

View File

@ -79,7 +79,9 @@ UsrMessageNatives::~UsrMessageNatives()
void UsrMessageNatives::OnSourceModAllInitialized()
{
HandleAccess sec;
sec.access[HandleAccess_Delete] |= HANDLE_RESTRICT_IDENTITY;
g_HandleSys.InitAccessDefaults(NULL, &sec);
sec.access[HandleAccess_Delete] = HANDLE_RESTRICT_IDENTITY;
g_WrBitBufType = g_HandleSys.CreateType("BitBufWriter", this, 0, NULL, NULL, g_pCoreIdent, NULL);
g_RdBitBufType = g_HandleSys.CreateType("BitBufReader", this, 0, NULL, &sec, g_pCoreIdent, NULL);