]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/job.c
- Convert more atoi to str_to_int64() for DB.
[bacula/bacula] / bacula / src / dird / job.c
index 7544b6feffcbc2698e698fbd9981480d8635be5b..8175a89258ed14634fcf97cbe1076add0cfb25ee 100644 (file)
@@ -36,8 +36,6 @@ static void job_monitor_destructor(watchdog_t *self);
 static bool job_check_maxwaittime(JCR *control_jcr, JCR *jcr);
 static bool job_check_maxruntime(JCR *control_jcr, JCR *jcr);
 
-/* Exported subroutines */
-
 /* Imported subroutines */
 extern void term_scheduler();
 extern void term_ua_server();
@@ -740,15 +738,9 @@ void create_unique_job_name(JCR *jcr, const char *base_name)
    }
 }
 
-/*
- * 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;
@@ -787,7 +779,21 @@ void dird_free_jcr(JCR *jcr)
    }
    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;