Opened 17 years ago

Last modified 17 years ago

#2229 closed defect

msFreeHashItems should not set an error for a table with no items — at Version 5

Reported by: cph Owned by: sdlime
Priority: normal Milestone: 5.0 release
Component: MapServer C Library Version: svn-trunk (development)
Severity: normal Keywords:
Cc: hobu

Description (last modified by hobu)

msFreeHashItems is setting an error that eventually gets thrown as a exception in MapScript.

http://trac.osgeo.org/mapserver/ticket/2229#comment:4

Change History (5)

comment:1 by cph, 17 years ago

this is also a problem with "layer->metadata" in freeLayer

comment:2 by sdlime, 17 years ago

Status: newassigned

comment:3 by sdlime, 17 years ago

I don't see the problem. Neither freeLayer nor msFreeMap try to free the hashTableObj. They free the contents of the hash (e.g. msFreeHashItems) as expected.

Am I missing something? Are there errors popping up that can be attributed to this?

Steve

comment:4 by hobu, 17 years ago

Steve,

I think the problem is related to the setting of this error: http://trac.osgeo.org/mapserver/browser/trunk/mapserver/maphash.c#L115

If we have no items, there's nothing to free, but why is this an error?

Howard

Here's a current failure example:

======================================================================
ERROR: MapLayersTestCase.testMapInsertLayer: test insertion of a new layer at default (last) index
----------------------------------------------------------------------
Traceback (most recent call last):
  File "maptest.py", line 100, in testMapInsertLayer
    index = self.map.insertLayer(layer)
  File "/Users/hobu/svn/mapserver/mapscript/python/mapscript.py", line 776, in insertLayer
    def insertLayer(*args): return _mapscript.mapObj_insertLayer(*args)
MapServerError: msFreeHashItems(): Hash table error. No items allocated.


comment:5 by hobu, 17 years ago

Description: modified (diff)
Summary: fontObj should really be carrying around *hashTableObj instead of hashTableObjmsFreeHashItems should not set an error for a table with no items
Note: See TracTickets for help on using tickets.