Skip to content

Commit

Permalink
[geo] set temporary ID.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 22, 2011
1 parent 795f044 commit 68be71c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/geo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit 68be71c

Please sign in to comment.