Initialize the thing we're going to test to see whether we

succeeded... otherwise we'll be testing random quantities.  Bug 384264, r+sr=roc
This commit is contained in:
bzbarsky@mit.edu 2007-06-18 07:58:29 -07:00
parent d4193fc178
commit 5594639fe8

View File

@ -67,6 +67,9 @@ gfxXlibNativeRenderer::Draw(Display* dpy, gfxContext* ctx, int width, int height
{
NativeRenderingClosure closure = { this, NS_OK };
cairo_xlib_drawing_result_t result;
// Make sure result.surface is null to start with; we rely on it
// being non-null meaning that a surface actually got allocated.
result.surface = NULL;
if (output) {
output->mSurface = NULL;
@ -98,6 +101,7 @@ gfxXlibNativeRenderer::Draw(Display* dpy, gfxContext* ctx, int width, int height
output ? &result : NULL);
if (NS_FAILED(closure.mRV)) {
if (result.surface) {
NS_ASSERTION(output, "How did that happen?");
cairo_surface_destroy (result.surface);
}
return closure.mRV;