[vlc-commits] commit: lua_sd: force garbage collection once a while. ( Rémi Duraffort )

git at videolan.org git at videolan.org
Sat Oct 30 19:21:19 CEST 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Wed Oct 27 19:36:39 2010 +0200| [f7520eb1df0617816265140752b3f8ed9b187fbc] | committer: Rémi Duraffort 

lua_sd: force garbage collection once a while.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f7520eb1df0617816265140752b3f8ed9b187fbc
---

 modules/misc/lua/services_discovery.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/modules/misc/lua/services_discovery.c b/modules/misc/lua/services_discovery.c
index f8c42b5..097e6b4 100644
--- a/modules/misc/lua/services_discovery.c
+++ b/modules/misc/lua/services_discovery.c
@@ -74,7 +74,7 @@ int Open_LuaSD( vlc_object_t *p_this )
         // This module can be used to load lua script not registered
         // as builtin lua SD modules.
         config_ChainParse( p_sd, "lua-", ppsz_sd_options, p_sd->p_cfg );
-        psz_name = var_CreateGetString( p_sd, "lua-sd" );
+        psz_name = var_GetString( p_sd, "lua-sd" );
     }
     else
     {
@@ -233,6 +233,10 @@ static void* Run( void *data )
             free( psz_query );
             vlc_mutex_lock( &p_sys->lock );
         }
+        /* 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 );
+
         vlc_restorecancel( cancel );
     }
     vlc_cleanup_run();



More information about the vlc-commits mailing list