}
}
-/*
- * Free the Job Control Record if no one is still using it.
- * Called from main free_jcr() routine in src/lib/jcr.c so
- * that we can do our Director specific cleanup of the jcr.
- */
-void dird_free_jcr(JCR *jcr)
+/* Called directly from job rescheduling */
+void dird_free_jcr_pointers(JCR *jcr)
{
- Dmsg0(200, "Start dird free_jcr\n");
-
if (jcr->sd_auth_key) {
free(jcr->sd_auth_key);
jcr->sd_auth_key = NULL;
}
if (jcr->term_wait_inited) {
pthread_cond_destroy(&jcr->term_wait);
+ jcr->term_wait_inited = false;
}
+}
+
+/*
+ * Free the Job Control Record if no one is still using it.
+ * Called from main free_jcr() routine in src/lib/jcr.c so
+ * that we can do our Director specific cleanup of the jcr.
+ */
+void dird_free_jcr(JCR *jcr)
+{
+ Dmsg0(200, "Start dird free_jcr\n");
+
+ dird_free_jcr_pointers(jcr);
+
/* Delete lists setup to hold storage pointers */
if (jcr->storage) {
delete jcr->storage;
bstrftime(dt, sizeof(dt), time(NULL));
Jmsg(jcr, M_INFO, 0, _("Rescheduled Job %s at %s to re-run in %d seconds.\n"),
jcr->Job, dt, (int)jcr->job->RescheduleInterval);
- dird_free_jcr(jcr); /* partial cleanup old stuff */
+ dird_free_jcr_pointers(jcr); /* partial cleanup old stuff */
jcr->JobStatus = JS_WaitStartTime;
jcr->SDJobStatus = 0;
if (jcr->JobBytes == 0) {