IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 21 years ago

Closed 21 years ago

Last modified 20 years ago

#449 closed defect (fixed)

some psArray functions don't handle reference counting

Reported by: jhoblitt Owned by: robert.desonia@…
Priority: high Milestone:
Component: types Version: 0.6.0
Severity: normal Keywords:
Cc:

Description

psArrayRemove() - does not call psFree()
psArraySet() - does not call psMemIncrRefCounter() on new values / does not call
psFree() on replaced values
psArrayGet() - does not call psMemIncrRefCounter()

I'm a little unsure of what psArrayGet() should do as I'm not sure how it fits
into the scheme of views vs. control. My feeling is that it should call
psMemIncrRefCounter() and that this should be clearly documented. If a 'view
only' accessor is needed then we can add something like psArrayLookup().

Change History (6)

comment:1 by Paul Price, 21 years ago

I think we decided that all collection functions should implement reference
counting. So if you pull something off a collection using a psLib API (e.g.,
psArrayGet), the reference counter should be incremented and it is the users job
to psFree it when done.

I am loath to have a "view only" accessor --- I think it is important to have a
single blanket policy for this.

comment:2 by jhoblitt, 21 years ago

Agreed. psArrayGet() should call psMemIncrRefCounter().

comment:3 by robert.desonia@…, 21 years ago

Status: newassigned

comment:4 by robert.desonia@…, 21 years ago

Resolution: fixed
Status: assignedclosed

Added decrement of reference in psArrayRemove
Added increment of reference in psArrayGet, psArraySet.
Verified that psArrayAdd properly incremented.

Modified psImage and psList, users of these functions, to now account for the reference counting for
sub-images and iterators, respectively.

Fixes are in CVS.

comment:5 by Paul Price, 20 years ago

Keywords: VERIFIED added

Bug has been resolved.... closing.

comment:6 by Paul Price, 20 years ago

Keywords: VERIFIED removed

Bugs have been fixed... closing.

Note: See TracTickets for help on using tickets.