intf_thread_t *p_intf = (intf_thread_t*)p_this;
intf_sys_t *p_sys = p_intf->p_sys;
+ vlc_cancel( p_sys->thread );
+
vlc_mutex_lock( &p_sys->lock );
p_sys->exiting = true;
vlc_cond_signal( &p_sys->wait );
lua_pop( L, 1 );
}
struct pollfd *p_fds = malloc( i_fds * sizeof( struct pollfd ) );
+ vlc_cleanup_push( free, p_fds );
lua_pushnil( L );
int i = 0;
while( lua_next( L, 1 ) )
lua_pushinteger( L, p_fds[i].revents );
lua_settable( L, 1 );
}
- free( p_fds );
lua_pushinteger( L, i_ret );
+ vlc_cleanup_run();
return 1;
}