[FEThumbnails]Add cleanup code to avoid locking files (#32108)

This commit is contained in:
Laszlo Nemeth
2024-03-28 16:10:39 +01:00
committed by GitHub
parent fc3c421735
commit baba63542d
5 changed files with 33 additions and 0 deletions

View File

@@ -183,6 +183,12 @@ IFACEMETHODIMP GcodeThumbnailProvider::GetThumbnail(UINT cx, HBITMAP* phbmp, WTS
}
}
// ensure releasing the stream (not all if branches contain it)
if (m_pStream)
{
m_pStream->Release();
m_pStream = NULL;
}
return S_OK;
}

View File

@@ -182,6 +182,13 @@ IFACEMETHODIMP PdfThumbnailProvider::GetThumbnail(UINT cx, HBITMAP* phbmp, WTS_A
}
}
// ensure releasing the stream (not all if branches contain it)
if (m_pStream)
{
m_pStream->Release();
m_pStream = NULL;
}
return S_OK;
}

View File

@@ -183,6 +183,12 @@ IFACEMETHODIMP QoiThumbnailProvider::GetThumbnail(UINT cx, HBITMAP* phbmp, WTS_A
}
}
// ensure releasing the stream (not all if branches contain it)
if (m_pStream)
{
m_pStream->Release();
m_pStream = NULL;
}
return S_OK;
}

View File

@@ -181,6 +181,13 @@ IFACEMETHODIMP StlThumbnailProvider::GetThumbnail(UINT cx, HBITMAP* phbmp, WTS_A
}
}
// ensure releasing the stream (not all if branches contain it)
if (m_pStream)
{
m_pStream->Release();
m_pStream = NULL;
}
return S_OK;
}

View File

@@ -182,6 +182,13 @@ IFACEMETHODIMP SvgThumbnailProvider::GetThumbnail(UINT cx, HBITMAP* phbmp, WTS_A
}
}
// ensure releasing the stream (not all if branches contain it)
if (m_pStream)
{
m_pStream->Release();
m_pStream = NULL;
}
return S_OK;
}