From: Kern Sibbald Date: Tue, 25 Nov 2008 07:41:22 +0000 (+0000) Subject: Try to eliminate possible plugin termination problems X-Git-Tag: Release-3.0.0~550 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d4f13c5a1d2a6f3e2449e2aad0caa6bf63f669ea;p=bacula%2Fbacula Try to eliminate possible plugin termination problems git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8080 91ce42f0-d328-0410-95d8-f526ca767f89 --- 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"); }