From 6e31b2c71a55e047f7333ac96d2a569d7fbdafc1 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 25 Nov 2008 07:41:22 +0000 Subject: [PATCH] Try to eliminate possible plugin termination problems git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8080 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/dir_plugins.c | 5 ++++- bacula/src/dird/job.c | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bacula/src/dird/dir_plugins.c b/bacula/src/dird/dir_plugins.c index 45ca43af71..7710b5b1f7 100644 --- a/bacula/src/dird/dir_plugins.c +++ b/bacula/src/dird/dir_plugins.c @@ -166,7 +166,10 @@ void free_plugins(JCR *jcr) Dmsg2(dbglvl, "Free instance plugin_ctx_list=%p JobId=%d\n", jcr->plugin_ctx_list, jcr->JobId); foreach_alist(plugin, plugin_list) { /* Free the plugin instance */ - plug_func(plugin)->freePlugin(&plugin_ctx_list[i++]); + plug_func(plugin)->freePlugin(&plugin_ctx_list[i]); + plugin_ctx_list[i].bContext = NULL; + plugin_ctx_list[i].pContext = NULL; + i++; } free(plugin_ctx_list); jcr->plugin_ctx_list = NULL; diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index b20c7af0dd..5ca2141e3d 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -1023,8 +1023,6 @@ void dird_free_jcr(JCR *jcr) jcr->rstore_source = NULL; } - free_plugins(jcr); /* release instantiated plugins */ - /* Delete lists setup to hold storage pointers */ free_rwstorage(jcr); @@ -1033,6 +1031,8 @@ void dird_free_jcr(JCR *jcr) if (jcr->JobId != 0) write_state_file(director->working_directory, "bacula-dir", get_first_port_host_order(director->DIRaddrs)); + free_plugins(jcr); /* release instantiated plugins */ + Dmsg0(200, "End dird free_jcr\n"); } -- 2.39.5