Changeset fda4621228eace5666578fde08eceae320d9100b

Show
Ignore:
Timestamp:
08/01/08 20:38:24 (10 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1217623104 +0000
git-parent:

[324755ea4e8a1ed883615324688f92b9b4c97396]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1217623104 +0000
Message:

maybe? refs #47. This won't trigger on Linux for me, so valgrind is no help.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/lua.c

    r4f3e42d rfda4621  
    4949get_ci(lua_State *L) { 
    5050  noit_lua_check_info_t *v = NULL; 
    51   if(noit_hash_retrieve(&noit_coros, (const char *)&L, sizeof(L), (void **)&v)) 
     51  if(noit_hash_retrieve(&noit_coros, (const char *)&L, sizeof(L), (void **)&v)) { 
    5252    return v; 
     53  } 
    5354  return NULL; 
    5455} 
     
    569570static int 
    570571noit_lua_initiate(noit_module_t *self, noit_check_t *check) { 
     572  lua_State **coro_state_copy; 
    571573  LMC_DECL(L, self); 
    572574  struct nl_intcl *int_cl; 
     
    610612  ci->coro_state_ref = luaL_ref(L, -2); 
    611613  lua_pop(L, 1); /* pops noit_coros */ 
    612   noit_hash_store(&noit_coros, 
    613                   (const char *)&ci->coro_state, sizeof(ci->coro_state), 
    614                   ci); 
     614 
     615  coro_state_copy = malloc(sizeof(*coro_state_copy)); 
     616  *coro_state_copy = ci->coro_state; 
     617  noit_hash_replace(&noit_coros, 
     618                  (const char *)coro_state_copy, sizeof(*coro_state_copy), 
     619                  ci, free, NULL); 
    615620 
    616621  SETUP_CALL(ci->coro_state, "initiate", goto fail);