core/logic/smn_timers.cpp
changeset 3998 a40a92c903be
parent 3792 d8a07e40bcb6
     1.1 --- a/core/logic/smn_timers.cpp	Mon Aug 12 00:54:21 2013 +0100
     1.2 +++ b/core/logic/smn_timers.cpp	Mon Aug 12 00:57:26 2013 +0100
     1.3 @@ -208,6 +208,12 @@
     1.4  		return 0;
     1.5  	}
     1.6  
     1.7 +	pInfo->UserData = params[3];
     1.8 +	pInfo->Flags = flags;
     1.9 +	pInfo->Hook = pFunc;
    1.10 +	pInfo->Timer = pTimer;
    1.11 +	pInfo->pContext = pCtx;
    1.12 +
    1.13  	hndl = handlesys->CreateHandle(g_TimerType, pInfo, pCtx->GetIdentity(), g_pCoreIdent, NULL);
    1.14  
    1.15  	/* If we can't get a handle, the timer isn't refcounted against the plugin and 
    1.16 @@ -215,25 +221,13 @@
    1.17  	 */
    1.18  	if (hndl == BAD_HANDLE)
    1.19  	{
    1.20 -		/* Free this for completeness. */
    1.21 -		if (flags & TIMER_DATA_HNDL_CLOSE)
    1.22 -		{
    1.23 -			HandleSecurity sec(pCtx->GetIdentity(), g_pCoreIdent);
    1.24 -			handlesys->FreeHandle(params[3], &sec);
    1.25 -		}
    1.26 -		/* Zero everything so there's no conflicts */
    1.27 -		memset(pInfo, 0, sizeof(TimerInfo));
    1.28 +		pInfo->TimerHandle = BAD_HANDLE;
    1.29  		timersys->KillTimer(pTimer);
    1.30  
    1.31  		return pCtx->ThrowNativeError("Could not create timer, no more handles");
    1.32  	}
    1.33  
    1.34 -	pInfo->UserData = params[3];
    1.35 -	pInfo->Flags = flags;
    1.36  	pInfo->TimerHandle = hndl;
    1.37 -	pInfo->Hook = pFunc;
    1.38 -	pInfo->Timer = pTimer;
    1.39 -	pInfo->pContext = pCtx;
    1.40  
    1.41  	return hndl;
    1.42  }