Opened 17 years ago

Closed 17 years ago

#2203 closed defect (fixed)

Empty METADATA items on MAP, LAYER, and WEB

Reported by: hobu Owned by: sdlime
Priority: high Milestone: 5.0 release
Component: MapServer C Library Version:
Severity: major Keywords:
Cc: szekerest

Description

It seems that we are now keeping empty METADATA blocks around for these items. They show up when we do a mapObj.save().

<hobu>	The other issue that metadata thing causes is there are places 
        in the code that do things like 
        if(&(layer->metadata)) msFreeHashItems(&(layer->metadata));
<hobu>	layer->metadata is now an active pointer with 
        nothing in it, so we end up trying to free empty hashitems (and fail)
<sdlime> we need msHashIsEmpty function

Change History (5)

comment:1 by hobu, 17 years ago

Component: AGGMapServer C Library
Milestone: 5.0 release
Priority: normalhigh
Severity: normalmajor

comment:2 by hobu, 17 years ago

added msHashIsEmpty in r6458

comment:3 by hobu, 17 years ago

Cc: szekerest added

A couple of related questions about msFreeHashItems....

We shouldn't be using naked free's there right? Should we be using msFree?

Also, if the hash table is empty, why is it an error?

comment:4 by hobu, 17 years ago

r6459 just hops out of the function if the table is empty. Please revert if this is incorrect.

comment:5 by sdlime, 17 years ago

Resolution: fixed
Status: newclosed

I applied the msHashIsEmpty check in mapfile.c so that empty metadata blocks are not output.

One question, is there any benefit to implementing msHashIsEmpty as a macro as opposed to a function? Just wondering from a programming convention.

Howard, regarding changes in r6459, I moved the empty table check inside the if (table) check and that won't trigger an error. I did leave the other check on table->items just in case and it throws a more specific error (something is really screwed up if that ever showed up). Also changed to msFree's for the key/value un-allocations. r6461

Marking as fixed.

Steve

Note: See TracTickets for help on using tickets.