Changeset 20099 in vbox for trunk/src/VBox/Main/HardDiskImpl.cpp
- Timestamp:
- May 27, 2009 4:04:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/HardDiskImpl.cpp
r19533 r20099 490 490 ~ImageChain() 491 491 { 492 List::const_iterator last = end();493 last--;494 for (List::const_iterator it = begin(); it != end(); ++ it)495 {496 AutoWriteLock alock (*it);497 if (it == last)492 /* empty? */ 493 if (begin() != end()) 494 { 495 List::const_iterator last = end(); 496 last--; 497 for (List::const_iterator it = begin(); it != end(); ++ it) 498 498 { 499 Assert ( (*it)->m.state == MediaState_LockedRead 500 || (*it)->m.state == MediaState_LockedWrite); 501 if ((*it)->m.state == MediaState_LockedRead) 502 (*it)->UnlockRead (NULL); 503 else if ((*it)->m.state == MediaState_LockedWrite) 504 (*it)->UnlockWrite (NULL); 499 AutoWriteLock alock (*it); 500 if (it == last) 501 { 502 Assert ( (*it)->m.state == MediaState_LockedRead 503 || (*it)->m.state == MediaState_LockedWrite); 504 if ((*it)->m.state == MediaState_LockedRead) 505 (*it)->UnlockRead (NULL); 506 else if ((*it)->m.state == MediaState_LockedWrite) 507 (*it)->UnlockWrite (NULL); 508 } 509 else 510 { 511 Assert ((*it)->m.state == MediaState_LockedRead); 512 if ((*it)->m.state == MediaState_LockedRead) 513 (*it)->UnlockRead (NULL); 514 } 515 516 (*it)->releaseCaller(); 505 517 } 506 else507 {508 Assert ((*it)->m.state == MediaState_LockedRead);509 if ((*it)->m.state == MediaState_LockedRead)510 (*it)->UnlockRead (NULL);511 }512 513 (*it)->releaseCaller();514 518 } 515 519 }
Note:
See TracChangeset
for help on using the changeset viewer.