Bug 630096: Fix cairo_d2d_finish destruction order. r=jrmuizel a=joedrew

This commit is contained in:
Bas Schouten 2011-01-31 17:18:28 +01:00
parent e32b030dea
commit d1ce4d637c

View File

@ -2450,8 +2450,11 @@ _cairo_d2d_finish(void *surface)
reset_clip(d2dsurf);
cairo_release_device(&d2dsurf->device->base);
// We need to release the device after calling the constructor, since the
// device destruction may release the D3D/D2D libraries.
cairo_device_t *device = &d2dsurf->device->base;
d2dsurf->~cairo_d2d_surface_t();
cairo_release_device(device);
return CAIRO_STATUS_SUCCESS;
}