Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/emc/rs274ngc/interp_setup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ setup::setup() :
orient_valid(false),
orient_pose{0.0, 0.0, 0.0, 0.0, 0.0, 0.0},
kins_ctx(nullptr),
kins_comp_id(0),
kins_comp_id(-1),
kins_module{},
kins_joints(0),
kins_angular_joints(0),
Expand Down
4 changes: 2 additions & 2 deletions src/emc/rs274ngc/interp_workplane.cc
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,9 @@ void Interp::kins_release(setup_pointer s)
kinematicsUserFree(KINS_CTX(s));
s->kins_ctx = NULL;
}
if (s->kins_comp_id > 0) {
if (s->kins_comp_id >= 0) {
hal_exit(s->kins_comp_id);
s->kins_comp_id = 0;
s->kins_comp_id = -1;
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/emc/rs274ngc/rs274ngc_pre.cc
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,10 @@ int Interp::exit()
}
}

// task exits without destroying the interpreter: let go of the HAL
// component the kinematics was evaluated through, or it outlives task
// and the shutdown waits for it; the next use loads it again
kins_release(&_setup);
return INTERP_OK;
}

Expand Down
Loading