#2043 closed defect (fixed)
Inserting histogram and color table into HFA file causes duplicate entries
Reported by: | Sam Gillingham | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.4.5 |
Component: | GDAL_Raster | Version: | 1.4.4 |
Severity: | normal | Keywords: | hfa |
Cc: |
Description
Creates duplicate 'Descriptor_Table' entries that cause Imagine to crash. The proposed patch introduces tests into both the histogram code and color table code to ensure that 'Descriptor_Table', '#Bin_Function#', 'Histogram' nodes and the colour nodes are re-used if they already exist.
Attachments (1)
Change History (6)
by , 16 years ago
comment:1 by , 16 years ago
Keywords: | hfa added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:2 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I'm wondering if it will not cause memory leaks. The patch adds 'new HFAEntry()' calls without freeing the previous object (if it was freeabled) or freeing itself.
comment:3 by , 16 years ago
Unless I made a mistake in the patch, the existing 'new HFAEntry()' calls are wrapped with a test to reuse the existing node if it exists. So there shouldn't be any new objects created.
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Even,
I see no sign how this code would introduce new leaks. If you can substantiate your concern with valgrind please reopen the report.
comment:5 by , 16 years ago
You're right, no leak. I didn't realize that 'new HFAEntry()' was chaining the new object to other existing objects ! That's a rather uncommon coding pattern that I missed in my very quick review of the commit.
Proposed patch to prevent duplicate nodes being added