Skip to content

ParallelProgressReporter: treat an empty callback as "continue" - #7143

Merged
Fedr merged 1 commit into
masterfrom
agent/mlib-parallel-progress-empty-callback
Oct 15, 2026
Merged

Fedr merged 1 commit into
masterfrom
agent/mlib-parallel-progress-empty-callback

Conversation

@Grantim

@Grantim Grantim commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

makeObjectTreeFromFolder( folder, dicomOnly ) with the default empty callback (and makeObjectTreeFromZip, which forwards its callback) threw std::bad_function_call: it wraps the callback in ParallelProgressReporter, which invoked it unconditionally from operator() and from updateTask_ on the main thread.

Both calls now go through reportProgress( cb_, progress_ ), so an empty callback means "continue", as elsewhere in the library. makeObjectTreeFromFolder is the only user of ParallelProgressReporter.

Test: MRMesh.ParallelProgressReporterEmptyCallback reports a task from the reporter's own thread with an empty callback; it fails on master with "bad function call". MRTest passes locally in Release and Debug (531/531).

Found while writing the test in #7141, which can drop its [] ( float ) { return true; } workaround after this.

Generated with Claude Code

makeObjectTreeFromFolder (and makeObjectTreeFromZip, which forwards its
callback) threw std::bad_function_call when called with the default empty
callback, because ParallelProgressReporter invoked it unconditionally.
Call it through reportProgress, like other progress reporting does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Fedr
Fedr merged commit ec41ec0 into master Oct 15, 2026
59 checks passed
@Fedr
Fedr deleted the agent/mlib-parallel-progress-empty-callback branch October 15, 2026 09:41
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