Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ void NGMP_OnlineServicesManager::CaptureScreenshot(bool bResizeForTransmit, std:
memcpy(pixelData.data(), pBits, height * pitch);

// process on thread - track the thread so we can join it during shutdown
std::thread* pNewThread = new std::thread([cbOnDataAvailable, width, height, pixelData = std::move(pixelData), pDXsurf, pitch, bResizeForTransmit]()
std::thread* pNewThread = new std::thread([cbOnDataAvailable, width, height, pixelData = std::move(pixelData), pitch, bResizeForTransmit]()
{
CHECK_WORKER_THREAD;

Expand Down Expand Up @@ -654,11 +654,6 @@ void NGMP_OnlineServicesManager::CaptureScreenshot(bool bResizeForTransmit, std:
delete[] rgbData;
rgbData = nullptr;

if (pDXsurf != nullptr)
{
pDXsurf->Release();
}

// invoke cb
if (cbOnDataAvailable != nullptr)
{
Expand Down Expand Up @@ -715,12 +710,10 @@ void NGMP_OnlineServicesManager::CaptureScreenshot(bool bResizeForTransmit, std:
surfaceCopy = nullptr;
}

if (!bSucceeded) // if success, thread uses this and then destroys it
if (pDXsurf != nullptr)
{
if (pDXsurf != nullptr)
{
pDXsurf->Release();
}
pDXsurf->Release();
pDXsurf = nullptr;
}

// callback if failed
Expand Down
Loading