Changeset 79217 in vbox
- Timestamp:
- Jun 18, 2019 4:12:55 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r79211 r79217 839 839 AutoWriteLock treeLock(i_getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS); 840 840 841 std::map<Guid, DeviceType_T> uIdsForNotify; 841 // the order of notification is critical for GUI, so use std::list<std::pair> instead of map 842 std::list<std::pair<Guid, DeviceType_T> > uIdsForNotify; 842 843 843 844 HRESULT rc = S_OK; … … 863 864 if (SUCCEEDED(rc)) 864 865 { 865 uIdsForNotify [pHardDisk->i_getId()] = DeviceType_HardDisk;866 uIdsForNotify.push_back(std::pair<Guid, DeviceType_T>(pHardDisk->i_getId(), DeviceType_HardDisk)); 866 867 // Add children IDs to notification using non-recursive children enumeration. 867 868 std::vector<std::pair<MediaList::const_iterator, ComObjPtr<Medium> > > llEnumStack; … … 877 878 continue; 878 879 } 879 uIdsForNotify [(*llEnumStack.back().first)->i_getId()] = DeviceType_HardDisk;880 uIdsForNotify.push_back(std::pair<Guid, DeviceType_T>((*llEnumStack.back().first)->i_getId(), DeviceType_HardDisk)); 880 881 const MediaList& childMediaList = (*llEnumStack.back().first)->i_getChildren(); 881 882 if (!childMediaList.empty()) … … 914 915 rc = i_registerMedium(pImage, &pImage, treeLock); 915 916 if (SUCCEEDED(rc)) 916 uIdsForNotify [pImage->i_getId()] = DeviceType_DVD;917 uIdsForNotify.push_back(std::pair<Guid, DeviceType_T>(pImage->i_getId(), DeviceType_DVD)); 917 918 // Avoid trouble with lock/refcount, before returning or not. 918 919 treeLock.release(); … … 941 942 rc = i_registerMedium(pImage, &pImage, treeLock); 942 943 if (SUCCEEDED(rc)) 943 uIdsForNotify [pImage->i_getId()] = DeviceType_Floppy;944 uIdsForNotify.push_back(std::pair<Guid, DeviceType_T>(pImage->i_getId(), DeviceType_Floppy)); 944 945 // Avoid trouble with lock/refcount, before returning or not. 945 946 treeLock.release(); … … 951 952 if (SUCCEEDED(rc)) 952 953 { 953 for (std:: map<com::Guid, DeviceType_T>::const_iterator itItem = uIdsForNotify.begin();954 for (std::list<std::pair<Guid, DeviceType_T> >::const_iterator itItem = uIdsForNotify.begin(); 954 955 itItem != uIdsForNotify.end(); 955 956 ++itItem)
Note:
See TracChangeset
for help on using the changeset viewer.