--- C:\builds\redland-1.0.8_orig\librdf\rdf_init.c Mon Jun 30 23:10:26 2008 +++ C:\builds\redland-1.0.8_good\librdf\rdf_init.c Thu Jul 31 09:59:57 2008 @@ -201,20 +201,36 @@ librdf_finish_digest(world); #ifdef WITH_THREADS - if (world->mutex) - { - pthread_mutex_destroy(world->statements_mutex); - SYSTEM_FREE(world->statements_mutex); - world->statements_mutex = NULL; - pthread_mutex_destroy(world->nodes_mutex); - SYSTEM_FREE(world->nodes_mutex); - world->nodes_mutex = NULL; + if (world->hash_datums_mutex) + { + pthread_mutex_destroy(world->hash_datums_mutex); + SYSTEM_FREE(world->hash_datums_mutex); + world->hash_datums_mutex = NULL; + } - pthread_mutex_destroy(world->mutex); + if (world->statements_mutex) + { + pthread_mutex_destroy(world->statements_mutex); + SYSTEM_FREE(world->statements_mutex); + world->statements_mutex = NULL; + } + + if (world->nodes_mutex) + { + pthread_mutex_destroy(world->nodes_mutex); + SYSTEM_FREE(world->nodes_mutex); + world->nodes_mutex = NULL; + } + + if (world->mutex) + { + pthread_mutex_destroy(world->mutex); SYSTEM_FREE(world->mutex); world->mutex = NULL; - } + } + + #endif #ifdef MODULAR_LIBRDF @@ -244,6 +260,10 @@ world->statements_mutex = (pthread_mutex_t *) SYSTEM_MALLOC(sizeof(pthread_mutex_t)); pthread_mutex_init(world->statements_mutex, NULL); + + world->hash_datums_mutex = (pthread_mutex_t *) SYSTEM_MALLOC(sizeof(pthread_mutex_t)); + pthread_mutex_init(world->hash_datums_mutex, NULL); + #else #endif }