Merge pull request #401 from dnc40085/dev096-wifi-sta-getap_fix

Fix for memory leak in function wifi.sta.getap()
This commit is contained in:
Vowstar 2015-05-07 20:56:54 +08:00
commit 608d5f6be0
1 changed files with 5 additions and 0 deletions

View File

@ -86,6 +86,11 @@ static void wifi_scan_done(void *arg, STATUS status)
lua_pushnil(gL);
}
lua_call(gL, 1, 0);
if(wifi_scan_succeed != LUA_NOREF)
{
luaL_unref(gL, LUA_REGISTRYINDEX, wifi_scan_succeed);
wifi_scan_succeed = LUA_NOREF;
}
}
// Lua: smart(channel, function succeed_cb)