Changeset 55427 in vbox for trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
- Timestamp:
- Apr 24, 2015 2:49:11 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.