The root cause is when a DxgiContext is reseted, it has not been correctly
cleared from DxgiOutputDuplicator. So during next CaptureFrame() function call,
DxgiOutputDuplicator will spread the context change to a deleted instance.

BUG=741252

Review-Url: https://codereview.webrtc.org/2975103002
Cr-Commit-Position: refs/heads/master@{#18992}
This commit is contained in:
zijiehe 2017-07-12 17:29:36 -07:00 committed by Commit Bot
parent 7b0c6fa274
commit 67e438ffe5
2 changed files with 4 additions and 4 deletions

View File

@ -21,10 +21,11 @@ DxgiAdapterContext::~DxgiAdapterContext() = default;
DxgiFrameContext::DxgiFrameContext() = default;
DxgiFrameContext::~DxgiFrameContext() {
DxgiDuplicatorController::Instance()->Unregister(this);
Reset();
}
void DxgiFrameContext::Reset() {
DxgiDuplicatorController::Instance()->Unregister(this);
controller_id = 0;
}

View File

@ -102,9 +102,8 @@ class DxgiDuplicatorController {
int ScreenCount();
private:
// DxgiFrameContext calls private Unregister(Context*) function during
// destructing.
friend DxgiFrameContext::~DxgiFrameContext();
// DxgiFrameContext calls private Unregister(Context*) function in Reset().
friend void DxgiFrameContext::Reset();
// scoped_refptr<DxgiDuplicatorController> accesses private AddRef() and
// Release() functions.