#574 closed defect (fixed)
pmSubtractBias won't return a psSpline1D
| Reported by: | Paul Price | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | detrend | Version: | 0.8.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I tried calling pmSubtractBias with and without pre-allocating a psSpline1D as
the fitSpec, but couldn't get it to return a non-NULL fitSpec.
This might be related to the alterations made to the psSpline1D about a month ago.
Change History (6)
comment:1 by , 21 years ago
| Owner: | changed from to |
|---|
comment:2 by , 21 years ago
| Owner: | changed from to |
|---|
comment:3 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
comment:5 by , 21 years ago
If pmSubtractBias() is called with fitSpec being an already allocated spline
then I wrote a routine which explictly copies the newly generated spline in
pmSubtractBias() to the fitSpec argument. I verified this works in the current
CVS tree, however if you check that out, there are still some memory leak problems.
Speaking of the memory stuff, when I create an entire FPA->chip->cell->readout
hierarchy, should I be able to free the whole thing with a simple psFree(FPA)?
Or must I free some of the sub trees as well?
comment:6 by , 21 years ago
| bug_group: | → tessalation? |
|---|
Freeing the FPA should free all the dependent elements.
Shouldn't the fix to pmSubtractBias be as simple as:
pmSubtractBias(..., void fitSpec, pmFit fit, ...)
{
....
psSpline1D *spline = NULL; Spline to use in fitting overscan
if (fit == PM_FIT_SPLINE) {
if (fitSpec && *fitSpec) {
We're given a spline; use that.
spline = *fitSpec;
} else if (fitSpec && ! *fitSpec) {
We're given a pointer to NULL; create a spline to pass back
spline = psSpline1DAlloc();
*fitSpec = spline;
} else {
Told to use a spline, but the user doesn't want it back.
...
}
}
....
}

This should be done.