Skip to content

Use NewColorbar more consistently - #2655

Merged
gforney merged 1 commit into
firemodels:masterfrom
JakeOShannessy:colorbar-allocation
Aug 12, 2026
Merged

Use NewColorbar more consistently#2655
gforney merged 1 commit into
firemodels:masterfrom
JakeOShannessy:colorbar-allocation

Conversation

@JakeOShannessy

Copy link
Copy Markdown
Contributor

I encountered a bug when you have exactly 10 user defined colorbars with 3 or more colorbars defined in the ini file.. The code which reads the .ini files wasn't allocating extra space in the same way as other instances in the code, and therefore could attempt to write to unallocated memory with a certain number of colorbars.

Other code generally uses the NewColorbar function, which deals with all the memory resize logic and initialization. The PR updates the two locations remaining locations which didn't use that function (thereby addressing the bug).

NewColorbar is now the only place in the code which increments ncolorbars.

This also adds a little more documentation where appropriate.

There is a function (NewColorbar) which deals with the bookkeeping
around allocating memory for colorbars.

Use NewColobar in readsmv.c where previously different approaches were
taken to allocting colobar memory. This ensures a consistent approach.
@gforney

gforney commented Aug 11, 2026 via email

Copy link
Copy Markdown
Contributor

@gforney
gforney merged commit b48c337 into firemodels:master Aug 12, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants