Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do no free external trailing text strings #7557

Merged
merged 4 commits into from
Jun 22, 2023
Merged

Conversation

PaulWessel
Copy link
Member

See GenericMappingTools/pygmt#2524 for background. Sees we are trying to free strings thar belong to Python and not GMT. However, not solved yet.

@seisman if you see other places in the code where we need to do something like here, let me know. I see we have a VECTOR hidden flag for VH->alloc_mode_text and now we added a per segment SH->alloc_mode_text. Suspect there is still some lack of communication between vector and segment internally that is missing.
Will return to this later but feel tree to try it. It still have me the same messages.

See GenericMappingTools/pygmt#2524 for background.  Sees we are trying to free strings thar belong to Python and not GMT.  However, not solved yet.
@PaulWessel PaulWessel added the bug Something isn't working label Jun 19, 2023
@PaulWessel PaulWessel added this to the 6.5.0 milestone Jun 19, 2023
@PaulWessel PaulWessel requested a review from seisman June 19, 2023 09:17
@PaulWessel PaulWessel self-assigned this Jun 19, 2023
src/gmt_io.c Outdated
gmt_M_str_free (S->text[row]);
gmt_M_free (GMT, S->text);
if (S->text == NULL) return; /* No trailing text array */
if (SH->alloc_mode_text == GMT_ALLOC_INTERNALLY) { /* We can free these strings */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text misalignment here

src/gmt_io.c Outdated Show resolved Hide resolved
PaulWessel and others added 2 commits June 22, 2023 11:37
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@PaulWessel PaulWessel changed the title WIP Do no free external trailing text strings Do no free external trailing text strings Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants