]> git.sesse.net Git - vlc/blobdiff - modules/misc/lua/services_discovery.c
luasd: Force a garbage collect at the end of Run().
[vlc] / modules / misc / lua / services_discovery.c
index 0b33f93eee8099ce175ee2297a7969588bd82dcc..6dcbc4af1452e0797ba408f24d199963a2b84b04 100644 (file)
@@ -172,5 +172,10 @@ static void* Run( void *data )
         return NULL;
     }
     msg_Dbg( p_sd, "LuaSD script loaded: %s", p_sys->psz_filename );
+
+    /* Force garbage collection, because the core will keep the SD
+     * open, but lua will never gc until lua_close(). */
+    lua_gc( L, LUA_GCCOLLECT, 0 );
+
     return NULL;
 }