]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/autochanger.c
Add %D option to edit_job_code, simplify callbacks on director side
[bacula/bacula] / bacula / src / stored / autochanger.c
index b63a585b18df2dcea3d5559584a97ed5042eb5b0..3d38739f44f7fabe0455006d4791d7f9d964d2a5 100644 (file)
@@ -405,10 +405,14 @@ bool unload_autochanger(DCR *dcr, int loaded)
          dev->set_slot(0);         /* nothing loaded */
       }
 
-      free_volume(dev);            /* Free any volume associated with this drive */
       free_pool_memory(changer);
    }
    unlock_changer(dcr);
+
+   if (loaded > 0) {           /* free_volume outside from changer lock */
+      free_volume(dev);        /* Free any volume associated with this drive */
+   }
+
    if (ok) {
       dev->clear_unload();
    }