--- libaitrpc/src/lists.c 2011/09/01 14:28:41 1.4.2.4 +++ libaitrpc/src/lists.c 2011/09/03 13:18:26 1.4.2.6 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: lists.c,v 1.4.2.4 2011/09/01 14:28:41 misho Exp $ +* $Id: lists.c,v 1.4.2.6 2011/09/03 13:18:26 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -355,12 +355,10 @@ rpc_srv_getBLOB(rpc_srv_t * __restrict srv, uint32_t v return NULL; } - pthread_mutex_lock(&srv->srv_blob.mtx); for (b = srv->srv_blob.blobs; b; b = b->blob_next) { if (b->blob_var == var) break; } - pthread_mutex_unlock(&srv->srv_blob.mtx); return b; } @@ -411,6 +409,9 @@ rpc_srv_unregisterBLOB(rpc_srv_t * __restrict srv, uin b = rpc_srv_getBLOB(srv, var); if (!b) /* not found element for unregister */ return 0; + /* if BLOB is unmapped force to unmap object */ + if (b->blob_data) + rpc_srv_blobUnmap(b); pthread_mutex_lock(&srv->srv_blob.mtx); if (srv->srv_blob.blobs == b) { /* if is 1st element */