]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/autochanger.c
Move reservations message lock to lock jcr only this
[bacula/bacula] / bacula / src / stored / autochanger.c
index 88b42cdcec8f7720bf5007e6209218c8d9a533c6..2edd3f66c31cba429a984fa2167b4390403af540 100644 (file)
@@ -251,7 +251,7 @@ int get_autochanger_loaded_slot(DCR *dcr)
       return dev->Slot;
    }
    /* Virtual disk autochanger */
-   if (dcr->device->changer_command[0] ==0) {
+   if (dcr->device->changer_command[0] == 0) {
       return 1;
    }
 
@@ -360,6 +360,7 @@ bool unload_autochanger(DCR *dcr, int loaded)
       } else {
          dev->Slot = 0;            /* nothing loaded */
       }
+      free_volume(dev);            /* Free any volume associated with this drive */
       free_pool_memory(changer);
       unlock_changer(dcr);
    }
@@ -461,6 +462,7 @@ static bool unload_other_drive(DCR *dcr, int slot)
       dev->Slot = 0;           /* nothing loaded */
       Dmsg0(100, "Slot unloaded\n");
    }
+   free_volume(dev);               /* Free any volume associated with this drive */
    unlock_changer(dcr);
    dev->dunlock();
    free_pool_memory(changer_cmd);