Browse Source

turns out you actually have to free/destroy mutexes. who woulda thunk?

git.mgm/mediaproxy-ng/2.1
Richard Fuchs 14 years ago
parent
commit
45f34b9784
3 changed files with 5 additions and 0 deletions
  1. +2
    -0
      daemon/aux.h
  2. +2
    -0
      daemon/call.c
  3. +1
    -0
      daemon/control.c

+ 2
- 0
daemon/aux.h View File

@ -153,6 +153,7 @@ typedef GStaticRWLock rwlock_t;
typedef GCond *cond_t;
#define mutex_init(m) g_static_mutex_init(m)
#define mutex_destroy(m) g_static_mutex_free(m)
#define mutex_lock(m) g_static_mutex_lock(m)
#define mutex_trylock(m) g_static_mutex_trylock(m)
#define mutex_unlock(m) g_static_mutex_unlock(m)
@ -176,6 +177,7 @@ typedef GRWLock rwlock_t;
typedef GCond cond_t;
#define mutex_init(m) g_mutex_init(m)
#define mutex_destroy(m) g_mutex_clear(m)
#define mutex_lock(m) g_mutex_lock(m)
#define mutex_trylock(m) g_mutex_trylock(m)
#define mutex_unlock(m) g_mutex_unlock(m)


+ 2
- 0
daemon/call.c View File

@ -1108,6 +1108,7 @@ static void callstream_free(void *ptr) {
release_port(r);
}
}
mutex_destroy(&s->lock);
obj_put(s->call);
}
@ -1465,6 +1466,7 @@ static void call_free(void *p) {
free(c->called_agent);
g_queue_free(c->callstreams);
free(c->callid);
mutex_destroy(&c->lock);
}
static struct call *call_create(const char *callid, struct callmaster *m) {


+ 1
- 0
daemon/control.c View File

@ -204,6 +204,7 @@ static void control_stream_free(void *p) {
close(s->fd);
streambuf_destroy(s->inbuf);
streambuf_destroy(s->outbuf);
mutex_destroy(&s->lock);
}
static void control_incoming(int fd, void *p, uintptr_t u) {


Loading…
Cancel
Save