mirror of https://github.com/PCSX2/pcsx2.git
GSCapture: Fix a premature GSSource release
CUnknown starts with a refcount of 0, so a "nonstandard" assignment needs to be performed, even though it looks like a COM reference leak at the first glance.
This commit is contained in:
parent
4c941f81ec
commit
0ab31a2e9f
|
@ -470,8 +470,10 @@ bool GSCapture::BeginCapture(float fps, GSVector2i recommendedResolution, float
|
|||
}
|
||||
|
||||
HRESULT source_hr = S_OK;
|
||||
wil::com_ptr_nothrow<IBaseFilter> src;
|
||||
src.attach(new GSSource(m_size.x, m_size.y, fps, NULL, source_hr, dlg.m_colorspace));
|
||||
// WARNING: This increases the reference count! Right now it's fine, since GSSource inherits from CUnknown that
|
||||
// starts the reference count from 0. Should this ever change and GSSource ends up with a refcount of 1 after constructing,
|
||||
// change this to `.attach(new GSSource(...))`.
|
||||
wil::com_ptr_nothrow<IBaseFilter> src = new GSSource(m_size.x, m_size.y, fps, NULL, source_hr, dlg.m_colorspace);
|
||||
|
||||
if (dlg.m_enc == 0)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue