Skip to content

Job::removeJob: call job_handlerst_remove_job instead of the vmethod - #5909

Merged
ab9rf merged 1 commit into
DFHack:developfrom
Alistair-Afton:remove-job-global
Sep 15, 2026
Merged

ab9rf merged 1 commit into
DFHack:developfrom
Alistair-Afton:remove-job-global

Conversation

@Alistair-Afton

Copy link
Copy Markdown
Contributor

Summary

Fixes #5903.

DFHack::Job::removeJob called the job_handler::cancel_job vmethod through a manual pointer indirection to stop GCC from optimizing the call out. The globals table has provided job_handlerst_remove_job for years, so the workaround is no longer needed; this calls the global function directly, using the same std::function reinterpret_cast pattern as Buildings::completeBuild.

No changelog entry since this is not user-visible.

Testing

  • Built and installed locally (win64, DF 53.16).
  • In a live fort, dfhack.job.removeJob on a job with item refs removed it cleanly (job list 716 -> 715, no crash).

The globals table has provided job_handlerst_remove_job for years, so
the indirect vmethod call (with the GCC workaround) is no longer needed.
Same pattern as Buildings::completeBuild.

Fixes DFHack#5903
@ab9rf
ab9rf merged commit 77ae9ba into DFHack:develop Sep 15, 2026
14 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.

Start using "job_handlerst_remove_job" function

2 participants