Opened 9 years ago

Closed 6 years ago

#2729 closed enhancement (fixed)

Missing Vect_new_map_struct

Reported by: rblazek Owned by: grass-dev@…
Priority: normal Milestone: 7.4.0
Component: Vector Version: svn-trunk
Keywords: Cc:
CPU: Unspecified Platform: All

Description

There is no function to allocate Map_info. If GRASS library is used in another application (QGIS for example) which is compiled by a compiller with different ABI, calls to Vect_ functions using Map_info structure allocated by the other application may result in crash. The problem was discussed here: http://lists.osgeo.org/pipermail/grass-dev/2015-June/075539.html

A patch against trunk r66029 introducing Vect_new_map_struct and Vect_destroy_map_struct is attached. I am not sure what should be a policy for releasing Map_info members.

Attachments (1)

Vect_new_map_struct.patch (1.6 KB ) - added by rblazek 9 years ago.
Patch for r66029 introducing Vect_new_map_struct and Vect_destroy_map_struct

Download all attachments as: .zip

Change History (9)

by rblazek, 9 years ago

Attachment: Vect_new_map_struct.patch added

Patch for r66029 introducing Vect_new_map_struct and Vect_destroy_map_struct

comment:1 by neteler, 9 years ago

Milestone: 7.0.1

Should G_malloc() be used instead of malloc()?

comment:2 by huhabla, 9 years ago

Milestone: 7.0.17.1.0

Patch applied in r66048. I did not modified the patch to use G_malloc(), since the error message would be generic then. However, if this is not of importance, then we should use G_malloc() and remove the function specific G_fatal_error() call.

comment:3 by neteler, 8 years ago

Milestone: 7.1.07.2.0

Milestone renamed

comment:4 by neteler, 7 years ago

Milestone: 7.2.07.2.1

Ticket retargeted after milestone closed

comment:5 by martinl, 7 years ago

Milestone: 7.2.17.2.2

comment:6 by martinl, 7 years ago

Milestone: 7.2.27.4.0

All enhancement tickets should be assigned to 7.4 milestone.

comment:7 by neteler, 6 years ago

Milestone: 7.4.07.4.1

Ticket retargeted after milestone closed

comment:8 by martinl, 6 years ago

Milestone: 7.4.17.4.0
Resolution: fixed
Status: newclosed

Seems to be already solved.

Note: See TracTickets for help on using tickets.