mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 665218 - Keep the printing surface until the next BeginPage to avoid null-ptr crash [MacOSX only]. r=roc
This commit is contained in:
parent
d93810c1a5
commit
5437bbbfbe
@ -634,10 +634,14 @@ nsDeviceContext::BeginPage(void)
|
||||
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
/* We need to get a new surface for each page on the Mac */
|
||||
#ifdef XP_MACOSX
|
||||
// We need to get a new surface for each page on the Mac, as the
|
||||
// CGContextRefs are only good for one page.
|
||||
// And we don't null it out in EndPage because mPrintingSurface needs
|
||||
// to be available also in-between EndPage/BeginPage (bug 665218).
|
||||
mDeviceContextSpec->GetSurfaceForPrinter(getter_AddRefs(mPrintingSurface));
|
||||
#endif
|
||||
|
||||
rv = mPrintingSurface->BeginPage();
|
||||
|
||||
return rv;
|
||||
@ -648,13 +652,6 @@ nsDeviceContext::EndPage(void)
|
||||
{
|
||||
nsresult rv = mPrintingSurface->EndPage();
|
||||
|
||||
/* We need to release the CGContextRef in the surface here, plus it's
|
||||
not something you would want anyway, as these CGContextRefs are only good
|
||||
for one page. */
|
||||
#ifdef XP_MACOSX
|
||||
mPrintingSurface = nsnull;
|
||||
#endif
|
||||
|
||||
if (mDeviceContextSpec)
|
||||
mDeviceContextSpec->EndPage();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user