aboutsummaryrefslogtreecommitdiff
path: root/src/lanes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lanes.c')
-rw-r--r--src/lanes.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lanes.c b/src/lanes.c
index f2e3065..037e44f 100644
--- a/src/lanes.c
+++ b/src/lanes.c
@@ -733,7 +733,10 @@ static int selfdestruct_gc( lua_State* L)
733 // necessary so that calling free_deep_prelude doesn't crash because linda_id expects a linda lightuserdata at absolute slot 1 733 // necessary so that calling free_deep_prelude doesn't crash because linda_id expects a linda lightuserdata at absolute slot 1
734 lua_settop( L, 0); 734 lua_settop( L, 0);
735 // no need to mutex-protect this as all threads in the universe are gone at that point 735 // no need to mutex-protect this as all threads in the universe are gone at that point
736 -- U->timer_deep->refcount; // should be 0 now 736 if( U->timer_deep != NULL) // test ins case some early internal error prevented Lanes from creating the deep timer
737 {
738 -- U->timer_deep->refcount; // should be 0 now
739 }
737 free_deep_prelude( L, (DeepPrelude*) U->timer_deep); 740 free_deep_prelude( L, (DeepPrelude*) U->timer_deep);
738 U->timer_deep = NULL; 741 U->timer_deep = NULL;
739 742
@@ -2162,7 +2165,6 @@ LUAG_FUNC( configure)
2162 2165
2163 // Proxy userdata contents is only a 'DEEP_PRELUDE*' pointer 2166 // Proxy userdata contents is only a 'DEEP_PRELUDE*' pointer
2164 U->timer_deep = *(DeepPrelude**) lua_touserdata( L, -1); 2167 U->timer_deep = *(DeepPrelude**) lua_touserdata( L, -1);
2165 ASSERT_L( U->timer_deep && (U->timer_deep->refcount == 1) && U->timer_deep->deep && U->timer_deep->idfunc == linda_id);
2166 // increment refcount that this linda remains alive as long as the universe is. 2168 // increment refcount that this linda remains alive as long as the universe is.
2167 ++ U->timer_deep->refcount; 2169 ++ U->timer_deep->refcount;
2168 lua_pop( L, 1); // settings 2170 lua_pop( L, 1); // settings