Skip to content

cfg/gtk.cfg: Remove incorrect GIOChannel destructors - #8069

Open
jtojnar wants to merge 1 commit into
cppcheck-opensource:mainfrom
jtojnar:glib-channel-non-desctructors
Open

cfg/gtk.cfg: Remove incorrect GIOChannel destructors#8069
jtojnar wants to merge 1 commit into
cppcheck-opensource:mainfrom
jtojnar:glib-channel-non-desctructors

Conversation

@jtojnar

Copy link
Copy Markdown

shutdown and close methods do not actually unref the channel:

The channel will not be freed until the last reference is dropped using g_io_channel_unref().

https://docs.gtk.org/glib/method.IOChannel.close.html
https://docs.gtk.org/glib/method.IOChannel.shutdown.html

@danmar

Copy link
Copy Markdown
Collaborator

The cppcheck-premium failure is not your fault. I have updated the license in the upstream repo. So if you rebase and rerun that job it should succeed.

`shutdown` and `close` methods do not actually unref the channel:
The channel will not be freed until the last reference is dropped using g_io_channel_unref().
https://docs.gtk.org/glib/method.IOChannel.close.htmlhttps://docs.gtk.org/glib/method.IOChannel.shutdown.html
@jtojnar
jtojnarforce-pushed the glib-channel-non-desctructors branch from bfe9679 to fabde6aCompareJanuary 2, 2026 23:09
@sonarqubecloud

Copy link
Copy Markdown

@chrchr-github

Copy link
Copy Markdown
Collaborator

Thanks for your contribution. Can you add a test to gtk.c?

Sign up for freeto 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.

3 participants

@jtojnar@danmar@chrchr-github