
Even tho the manpage says that the mutex in Linux don't use up resources, it
does.

And even so, for portability, we must destroy the mutex to allow jfs reuse
without memory leaks.


---

 cur-root/trans.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN trans.c~destroy_mutex trans.c
--- cur/trans.c~destroy_mutex	2004-07-24 22:14:49.151239368 -0300
+++ cur-root/trans.c	2004-07-24 22:59:10.354674952 -0300
@@ -127,6 +127,7 @@ void jtrans_free(struct jtrans *ts)
 
 		ts->op = tmpop;
 	}
+	pthread_mutex_destroy(&(ts->lock));
 }
 
 
@@ -617,6 +618,7 @@ int jclose(struct jfs *fs)
 		/* allocated by strdup() in jopen() */
 		free(fs->name);
 	munmap(fs->jmap, sizeof(unsigned int));
+	pthread_mutex_destroy(&(fs->lock));
 
 	return 0;
 }
_

