[Groonga-commit] groonga/groonga at 12d4bf1 [master] grn_db_create(): add missing CRITICAL_SECTION_FIN() call on error

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 8 15:27:43 JST 2015


Kouhei Sutou	2015-10-08 15:27:43 +0900 (Thu, 08 Oct 2015)

  New Revision: 12d4bf141a5db813ec8851bb253fbe8100da278d
  https://github.com/groonga/groonga/commit/12d4bf141a5db813ec8851bb253fbe8100da278d

  Message:
    grn_db_create(): add missing CRITICAL_SECTION_FIN() call on error

  Modified files:
    lib/db.c

  Modified: lib/db.c (+2 -1)
===================================================================
--- lib/db.c    2015-10-08 14:21:26 +0900 (966f0cc)
+++ lib/db.c    2015-10-08 15:27:43 +0900 (69a3dca)
@@ -192,6 +192,7 @@ grn_db_create(grn_ctx *ctx, const char *path, grn_db_create_optarg *optarg)
     goto exit;
   }
 
+  CRITICAL_SECTION_INIT(s->lock);
   grn_tiny_array_init(ctx, &s->values, sizeof(db_value),
                       GRN_TINY_ARRAY_CLEAR|
                       GRN_TINY_ARRAY_THREADSAFE|
@@ -227,7 +228,6 @@ grn_db_create(grn_ctx *ctx, const char *path, grn_db_create_optarg *optarg)
     goto exit;
   }
 
-  CRITICAL_SECTION_INIT(s->lock);
   GRN_DB_OBJ_SET_TYPE(s, GRN_DB);
   s->obj.db = (grn_obj *)s;
   s->obj.header.domain = GRN_ID_NIL;
@@ -265,6 +265,7 @@ exit:
       }
     }
     grn_tiny_array_fin(&s->values);
+    CRITICAL_SECTION_FIN(s->lock);
     GRN_FREE(s);
   }
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index