Skip to content

progress info: free the condition variable and the mutex on finalize - #3877

Open
KAMI911 wants to merge 1 commit into
linuxmint:masterfrom
KAMI911:fix-progress-info-leak
Open

KAMI911 wants to merge 1 commit into
linuxmint:masterfrom
KAMI911:fix-progress-info-leak

Conversation

@KAMI911

@KAMI911 KAMI911 commented Nov 8, 2026

Copy link
Copy Markdown

Summary

nemo_progress_info_init() allocated a GCond with the deprecated g_cond_new() that was never freed, and the GMutex was never cleared either. That leaks 16 bytes per progress info.

Embed the GCond in the struct (like info_lock already is) and use g_cond_init() / g_cond_clear() / g_mutex_clear(), so nothing is allocated per info any more.

Testing

A small program that creates and unrefs three progress infos, built with AddressSanitizer: 48 bytes leaked in 3 allocations before, none after. Only the file itself was compile-checked in a full Nemo build context.

🤖 Generated with Claude Code

The GCond was allocated with the deprecated g_cond_new() and never freed,
and the mutex was never cleared. Embed both in the struct and use
g_cond_init()/g_cond_clear() and g_mutex_clear(), so nothing is allocated
(and nothing leaks) per progress info.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.

1 participant