Opened 17 years ago
Closed 15 years ago
#2133 closed defect (duplicate)
Use of static var in MapScript mapObj.nextLabel
Reported by: | dmorissette | Owned by: | dmorissette |
---|---|---|---|
Priority: | normal | Milestone: | 6.0 release |
Component: | MapServer C Library | Version: | |
Severity: | normal | Keywords: | |
Cc: | sdlime |
Description (last modified by )
While working on the implementation of label priority, I noticed that the mapObj.nextLabel() method uses a static variable to iterate over labels. This is not safe for multi-thread environments, and does not allow using the function more than once per instance of label cache.
The same code is present in mapscript/swiginc/map.i and in mapscript/php3/mapscript_i.c
What do we want to do to fix it?
labelCacheMemberObj *nextLabel() { static int i=0; if(i<self->labelcache.numlabels) return &(self->labelcache.labels[i++]); else return NULL; }
Change History (5)
comment:1 by , 17 years ago
Description: | modified (diff) |
---|---|
Summary: | Use of static var in MapScript labelCacheObj.nextLabel → Use of static var in MapScript mapObj.nextLabel |
comment:2 by , 16 years ago
Component: | AGG → MapServer C Library |
---|
comment:3 by , 16 years ago
Milestone: | → 5.4 release |
---|
comment:4 by , 15 years ago
Milestone: | 5.4 release → 6.0 release |
---|
comment:5 by , 15 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Closing as duplicate of #1794.