Changeset 55427 in vbox for trunk/src/VBox/Main/src-client
- Timestamp:
- Apr 24, 2015 2:49:11 PM (10 years ago)
- Location:
- trunk/src/VBox/Main/src-client
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp
r55423 r55427 27 27 #include "AutoCaller.h" 28 28 29 #include <memory> /* For auto_ptr (deprecated) / unique_ptr, seee #7179. */30 31 29 #include <iprt/dir.h> 32 30 #include <iprt/file.h> … … 328 326 pRecvCtx->mFormat = aFormat; 329 327 330 std::auto_ptr <RecvDataTask> pTask(new RecvDataTask(this, pRecvCtx));328 RecvDataTask *pTask = new RecvDataTask(this, pRecvCtx); 331 329 AssertReturn(pTask->isOk(), pTask->getRC()); 332 330 333 331 rc = RTThreadCreate(NULL, GuestDnDSource::i_receiveDataThread, 334 (void *)pTask .get(), 0, RTTHREADTYPE_MAIN_WORKER, 0, "dndSrcRcvData");332 (void *)pTask, 0, RTTHREADTYPE_MAIN_WORKER, 0, "dndSrcRcvData"); 335 333 if (RT_SUCCESS(rc)) 336 334 { … … 338 336 ComAssertComRC(hr); 339 337 340 /* pTask is now owned by i_receiveDataThread(), so release it. */ 341 pTask.release(); 338 /* Note: pTask is now owned by the worker thread. */ 342 339 } 343 340 else if (pRecvCtx) … … 700 697 LogFlowFunc(("pvUser=%p\n", pvUser)); 701 698 702 std::auto_ptr<RecvDataTask> pTask(static_cast<RecvDataTask*>(pvUser)); 703 AssertPtr(pTask.get()); 704 705 const ComObjPtr<GuestDnDSource> pTarget(pTask->getSource()); 706 Assert(!pTarget.isNull()); 707 708 AutoCaller autoCaller(pTarget); 709 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 710 711 int rc = pTarget->i_receiveData(pTask->getCtx()); 712 /* Nothing to do here anymore. */ 713 714 LogFlowFunc(("pSource=%p returning rc=%Rrc\n", (GuestDnDSource *)pTarget, rc)); 699 RecvDataTask *pTask = (RecvDataTask *)pvUser; 700 AssertPtrReturn(pTask, VERR_INVALID_POINTER); 701 702 const ComObjPtr<GuestDnDSource> pSource(pTask->getSource()); 703 Assert(!pSource.isNull()); 704 705 int rc; 706 707 AutoCaller autoCaller(pSource); 708 if (SUCCEEDED(autoCaller.rc())) 709 { 710 rc = pSource->i_receiveData(pTask->getCtx()); 711 /* Nothing to do here anymore. */ 712 } 713 else 714 rc = VERR_COM_INVALID_OBJECT_STATE; 715 716 LogFlowFunc(("pSource=%p returning rc=%Rrc\n", (GuestDnDSource *)pSource, rc)); 717 718 delete pTask; 715 719 return rc; 716 720 } -
trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
r55426 r55427 28 28 29 29 #include <algorithm> /* For std::find(). */ 30 #include <memory> /* For auto_ptr (deprecated) / unique_ptr, seee #7179. */31 30 32 31 #include <iprt/file.h> … … 485 484 LogFlowFunc(("pvUser=%p\n", pvUser)); 486 485 487 std::auto_ptr<SendDataTask> pTask(static_cast<SendDataTask*>(pvUser));488 AssertPtr (pTask.get());486 SendDataTask *pTask = (SendDataTask *)pvUser; 487 AssertPtrReturn(pTask, VERR_INVALID_POINTER); 489 488 490 489 const ComObjPtr<GuestDnDTarget> pTarget(pTask->getTarget()); 491 490 Assert(!pTarget.isNull()); 492 491 492 int rc; 493 493 494 AutoCaller autoCaller(pTarget); 494 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 495 496 int rc = pTarget->i_sendData(pTask->getCtx()); 497 /* Nothing to do here anymore. */ 495 if (SUCCEEDED(autoCaller.rc())) 496 { 497 rc = pTarget->i_sendData(pTask->getCtx()); 498 /* Nothing to do here anymore. */ 499 } 500 else 501 rc = VERR_COM_INVALID_OBJECT_STATE; 498 502 499 503 LogFlowFunc(("pTarget=%p returning rc=%Rrc\n", (GuestDnDTarget *)pTarget, rc)); 504 505 delete pTask; 500 506 return rc; 501 507 } … … 544 550 pSendCtx->mData = aData; 545 551 546 std::auto_ptr<SendDataTask> pTask(new SendDataTask(this, pSendCtx));552 SendDataTask *pTask = new SendDataTask(this, pSendCtx); 547 553 AssertReturn(pTask->isOk(), pTask->getRC()); 548 554 549 555 vrc = RTThreadCreate(NULL, GuestDnDTarget::i_sendDataThread, 550 (void *)pTask .get(), 0, RTTHREADTYPE_MAIN_WORKER, 0, "dndTgtSndData");556 (void *)pTask, 0, RTTHREADTYPE_MAIN_WORKER, 0, "dndTgtSndData"); 551 557 if (RT_SUCCESS(vrc)) 552 558 { … … 554 560 ComAssertComRC(hr); 555 561 556 /* pTask is now owned by i_sendDataThread(), so release it. */ 557 pTask.release(); 562 /* Note: pTask is now owned by the worker thread. */ 558 563 } 559 564 else if (pSendCtx)
Note:
See TracChangeset
for help on using the changeset viewer.