[Groonga-commit] groonga/groonga [master] removed grn_geo_cursor_close() called after grn_obj_unlink().

Back to archive index

null+****@clear***** null+****@clear*****
2011年 11月 22日 (火) 19:06:08 JST


Susumu Yata	2011-11-22 10:06:08 +0000 (Tue, 22 Nov 2011)

  New Revision: 198c57e201611d11e66e87cad90874ac12eb8c55

  Log:
    removed grn_geo_cursor_close() called after grn_obj_unlink().

  Modified files:
    lib/geo.c

  Modified: lib/geo.c (+10 -2)
===================================================================
--- lib/geo.c    2011-11-22 08:15:52 +0000 (6daf7f4)
+++ lib/geo.c    2011-11-22 10:06:08 +0000 (dde52ce)
@@ -1056,7 +1056,6 @@ grn_geo_cursor_open_in_rectangle(grn_ctx *ctx,
     goto exit;
   }
 
-  GRN_DB_OBJ_SET_TYPE(cursor, GRN_CURSOR_COLUMN_GEO_INDEX);
   cursor->pat = data.pat;
   cursor->index = index;
   memcpy(&(cursor->top_left), data.top_left, sizeof(grn_geo_point));
@@ -1100,6 +1099,16 @@ grn_geo_cursor_open_in_rectangle(grn_ctx *ctx,
       cursor->minimum_reduce_bit = 1;
     }
   }
+  GRN_DB_OBJ_SET_TYPE(cursor, GRN_CURSOR_COLUMN_GEO_INDEX);
+  {
+    grn_obj *db;
+    grn_id id;
+    db = grn_ctx_db(ctx);
+    id = grn_obj_register(ctx, db, NULL, 0);
+    DB_OBJ(cursor)->header.domain = GRN_ID_NIL;
+    DB_OBJ(cursor)->range = GRN_ID_NIL;
+    grn_db_obj_init(ctx, db, id, DB_OBJ(cursor));
+  }
 
 exit :
   grn_obj_unlink(ctx, &(data.top_left_point_buffer));
@@ -1522,7 +1531,6 @@ grn_geo_select_in_rectangle(grn_ctx *ctx, grn_obj *index,
                         &data);
     grn_obj_unlink(ctx, cursor);
     grn_ii_resolve_sel_and(ctx, (grn_hash *)res, op);
-    grn_geo_cursor_close(ctx, cursor);
   }
 
   return ctx->rc;




Groonga-commit メーリングリストの案内
Back to archive index