Get rid of WrenMethod and just use WrenValue for both.

Thanks, Michel!
This commit is contained in:
Bob Nystrom
2015-08-31 07:57:48 -07:00
parent 1cea3ca3bc
commit 1e0a2e6036
4 changed files with 49 additions and 92 deletions
+3 -3
View File
@@ -46,7 +46,7 @@ static const char* timerLibSource =
"\n";
// The Wren method to call when a timer has completed.
static WrenMethod* resumeTimer;
static WrenValue* resumeTimer;
// Called by libuv when the timer finished closing.
static void timerCloseCallback(uv_handle_t* handle)
@@ -63,7 +63,7 @@ static void timerCallback(uv_timer_t* handle)
uv_close((uv_handle_t*)handle, timerCloseCallback);
// Run the fiber that was sleeping.
wrenCall(getVM(), resumeTimer, "v", fiber);
wrenCall(getVM(), resumeTimer, NULL, "v", fiber);
wrenReleaseValue(getVM(), fiber);
}
@@ -107,5 +107,5 @@ WrenForeignMethodFn timerBindForeign(
void timerReleaseMethods()
{
if (resumeTimer != NULL) wrenReleaseMethod(getVM(), resumeTimer);
if (resumeTimer != NULL) wrenReleaseValue(getVM(), resumeTimer);
}