Commit fad80b62 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Lua: revert should_die to using vlc_object_alive()

parent 2aca676c
...@@ -362,12 +362,8 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name ) ...@@ -362,12 +362,8 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name )
p_sys->L = L; p_sys->L = L;
vlc_mutex_init( &p_sys->lock );
p_sys->exiting = false;
if( vlc_clone( &p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW ) ) if( vlc_clone( &p_sys->thread, Run, p_intf, VLC_THREAD_PRIORITY_LOW ) )
{ {
vlc_mutex_destroy( &p_sys->lock );
lua_close( p_sys->L ); lua_close( p_sys->L );
goto error; goto error;
} }
...@@ -387,13 +383,7 @@ void Close_LuaIntf( vlc_object_t *p_this ) ...@@ -387,13 +383,7 @@ void Close_LuaIntf( vlc_object_t *p_this )
intf_sys_t *p_sys = p_intf->p_sys; intf_sys_t *p_sys = p_intf->p_sys;
vlc_cancel( p_sys->thread ); vlc_cancel( p_sys->thread );
vlc_mutex_lock( &p_sys->lock );
p_sys->exiting = true;
vlc_mutex_unlock( &p_sys->lock );
vlc_join( p_sys->thread, NULL ); vlc_join( p_sys->thread, NULL );
vlc_mutex_destroy( &p_sys->lock );
lua_close( p_sys->L ); lua_close( p_sys->L );
free( p_sys->psz_filename ); free( p_sys->psz_filename );
......
...@@ -147,8 +147,8 @@ static int vlclua_mwait( lua_State *L ) ...@@ -147,8 +147,8 @@ static int vlclua_mwait( lua_State *L )
static int vlclua_intf_should_die( lua_State *L ) static int vlclua_intf_should_die( lua_State *L )
{ {
intf_sys_t *p_sys = vlclua_get_intf( L ); vlc_object_t *p_this = vlclua_get_this( L );
lua_pushboolean( L, p_sys->exiting ); lua_pushboolean( L, !vlc_object_alive( p_this ) );
return 1; return 1;
} }
......
...@@ -164,8 +164,6 @@ struct intf_sys_t ...@@ -164,8 +164,6 @@ struct intf_sys_t
lua_State *L; lua_State *L;
vlc_thread_t thread; vlc_thread_t thread;
vlc_mutex_t lock;
bool exiting;
}; };
#endif /* VLC_LUA_H */ #endif /* VLC_LUA_H */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment