#302 closed defect (fixed)
psArrayAdd() does not properly handle reference counting
| Reported by: | jhoblitt | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | sys | Version: | 0.4.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
psArrayAdd() should increment the reference count on it's data parameter.
Consider the follow code example:
--
psArrayAdd(foo, 0, myData);
psFree(foo);
--
myData is now an invalid pointer without being free'd by the user.
Please also document the fact that psArrayAdd() incremements the reference count
on "data".
Change History (3)
comment:1 by , 21 years ago
| Status: | new → assigned |
|---|
comment:2 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:3 by , 21 years ago
The policy on reference counter incrementing is to be made more clear in the
upcoming SDRS, and will require checking that the other collection types do this
as well.
Note:
See TracTickets
for help on using tickets.

added the reference increment in CVS head.