Changeset 56909 in vbox for trunk/src/VBox/GuestHost/DragAndDrop
- Timestamp:
- Jul 10, 2015 6:09:14 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
r56903 r56909 43 43 DnDURIList::~DnDURIList(void) 44 44 { 45 Clear(); 45 46 } 46 47 … … 60 61 LogFlowFunc(("File '%s' -> '%s' (%RU64)\n", pcszSource, pcszTarget, (uint64_t)objInfo.cbObject)); 61 62 62 DnDURIObject objFile(DnDURIObject::File, pcszSource, pcszTarget); 63 if (fFlags & DNDURILIST_FLAGS_KEEP_OPEN) /* Shall we keep the file open while being added to this list? */ 64 { 65 /** @todo Add a standard fOpen mode for this list. */ 66 rc = objFile.Open(DnDURIObject::Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode); 67 } 68 69 if (RT_SUCCESS(rc)) 70 { 71 m_lstTree.append(objFile); 72 73 m_cTotal++; 74 m_cbTotal += (uint64_t)objInfo.cbObject; 75 } 63 DnDURIObject *pObjFile= new DnDURIObject(DnDURIObject::File, pcszSource, pcszTarget); 64 if (pObjFile) 65 { 66 if (fFlags & DNDURILIST_FLAGS_KEEP_OPEN) /* Shall we keep the file open while being added to this list? */ 67 { 68 /** @todo Add a standard fOpen mode for this list. */ 69 rc = pObjFile->Open(DnDURIObject::Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode); 70 } 71 72 if (RT_SUCCESS(rc)) 73 { 74 m_lstTree.append(pObjFile); 75 76 m_cTotal++; 77 m_cbTotal += pObjFile->GetSize(); 78 } 79 } 80 else 81 rc = VERR_NO_MEMORY; 76 82 } 77 83 else if (RTFS_IS_DIRECTORY(objInfo.Attr.fMode)) … … 79 85 LogFlowFunc(("Directory '%s' -> '%s' \n", pcszSource, pcszTarget)); 80 86 81 m_lstTree.append(DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget, 82 objInfo.Attr.fMode, 0 /* Size */)); 87 DnDURIObject *pObjDir= new DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget, 88 objInfo.Attr.fMode, 0 /* Size */); 89 if (pObjDir) 90 { 91 m_lstTree.append(pObjDir); 92 } 93 else 94 rc = VERR_NO_MEMORY; 83 95 84 96 /** @todo Add DNDURILIST_FLAGS_KEEP_OPEN handling. */ … … 397 409 { 398 410 m_lstRoot.clear(); 411 412 for (size_t i = 0; i < m_lstTree.size(); i++) 413 { 414 DnDURIObject *pCurObj = m_lstTree.at(i); 415 AssertPtr(pCurObj); 416 RTMemFree(pCurObj); 417 } 399 418 m_lstTree.clear(); 400 419 … … 408 427 return; 409 428 410 DnDURIObject &curObj = m_lstTree.first(); 411 412 uint64_t cbSize = curObj.GetSize(); 429 DnDURIObject *pCurObj = m_lstTree.first(); 430 AssertPtr(pCurObj); 431 432 uint64_t cbSize = pCurObj->GetSize(); 413 433 Assert(m_cbTotal >= cbSize); 414 434 m_cbTotal -= cbSize; /* Adjust total size. */ 415 435 416 curObj.Close(); 436 pCurObj->Close(); 437 RTMemFree(pCurObj); 417 438 418 439 m_lstTree.removeFirst();
Note:
See TracChangeset
for help on using the changeset viewer.