]> 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 ea79fcc778b07a236c2a51fcfb89eb8232c3299f..2edd3f66c31cba429a984fa2167b4390403af540 100644 (file)
@@ -7,8 +7,8 @@
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -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);