VirtualBox

Ignore:
Timestamp:
Sep 8, 2020 11:50:44 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9623: UIMediumManager: Make sure medium release call is done for every suitable attachment machine has, even if that's applicable to cd attachment only, not to hd/fd.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumItem.cpp

    r82968 r86065  
    442442bool UIMediumItemHD::releaseFrom(CMachine comMachine)
    443443{
     444    /* Was medium released from at least one attachment? */
     445    bool fAtLeastOneRelease = false;
     446
    444447    /* Enumerate attachments: */
    445448    CMediumAttachmentVector attachments = comMachine.GetMediumAttachments();
     
    467470            return false;
    468471        }
    469 
    470         /* Return success: */
    471         return true;
    472     }
    473 
    474     /* False by default: */
    475     return false;
     472        else
     473            fAtLeastOneRelease = true;
     474    }
     475
     476    /* Return whether there was at least one release: */
     477    return fAtLeastOneRelease;
    476478}
    477479
     
    561563bool UIMediumItemCD::releaseFrom(CMachine comMachine)
    562564{
     565    /* Was medium released from at least one attachment? */
     566    bool fAtLeastOneRelease = false;
     567
    563568    /* Enumerate attachments: */
    564569    CMediumAttachmentVector attachments = comMachine.GetMediumAttachments();
     
    581586            return false;
    582587        }
    583 
    584         /* Return success: */
    585         return true;
    586     }
    587 
    588     /* Return failure: */
    589     return false;
     588        else
     589            fAtLeastOneRelease = true;
     590    }
     591
     592    /* Return whether there was at least one release: */
     593    return fAtLeastOneRelease;
    590594}
    591595
     
    628632bool UIMediumItemFD::releaseFrom(CMachine comMachine)
    629633{
     634    /* Was medium released from at least one attachment? */
     635    bool fAtLeastOneRelease = false;
     636
    630637    /* Enumerate attachments: */
    631638    CMediumAttachmentVector attachments = comMachine.GetMediumAttachments();
     
    648655            return false;
    649656        }
    650 
    651         /* Return success: */
    652         return true;
    653     }
    654 
    655     /* Return failure: */
    656     return false;
    657 }
     657        else
     658            fAtLeastOneRelease = true;
     659    }
     660
     661    /* Return whether there was at least one release: */
     662    return fAtLeastOneRelease;
     663}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette