# HG changeset patch # User albeu # Date 1050155613 0 # Node ID eabe876ab5e2e161bff73c462d95aa269c08ae9d # Parent 3c856c0fc45e3e6f405fa1daf43c07d822fede2d Fix cache uninit diff -r 3c856c0fc45e -r eabe876ab5e2 libmpdemux/cache2.c --- a/libmpdemux/cache2.c Sat Apr 12 13:52:21 2003 +0000 +++ b/libmpdemux/cache2.c Sat Apr 12 13:53:33 2003 +0000 @@ -196,6 +196,16 @@ return s; } +void cache_uninit(stream_t *s) { + cache_vars_t* c = s->cache_data; + if(!s->cache_pid) return; + kill(s->cache_pid,SIGKILL); + waitpid(s->cache_pid,NULL,0); + if(!c) return; + shmem_free(c->buffer,c->buffer_size); + shmem_free(s->cache_data,sizeof(cache_vars_t)); +} + static void exit_sighandler(int x){ // close stream exit(0); diff -r 3c856c0fc45e -r eabe876ab5e2 libmpdemux/stream.c --- a/libmpdemux/stream.c Sat Apr 12 13:52:21 2003 +0000 +++ b/libmpdemux/stream.c Sat Apr 12 13:53:33 2003 +0000 @@ -391,10 +391,7 @@ // printf("\n*** free_stream() called ***\n"); #ifdef USE_STREAM_CACHE if(s->cache_pid) { -// kill(s->cache_pid,SIGTERM); - kill(s->cache_pid,SIGKILL); - waitpid(s->cache_pid,NULL,0); - shmem_free(s->cache_data); + cache_uninit(s); } #endif switch(s->type) {