diff options
author | Steve Chaplin <> | 2011-03-28 11:27:05 +0800 |
---|---|---|
committer | Steve Chaplin <> | 2011-03-28 11:27:05 +0800 |
commit | cab2c1295499f57247854e8635b77ca716fa9730 (patch) | |
tree | 081ddf2d9ba9473d8e2e8d19d6016c4328bffa80 | |
parent | a2e0d0ce26e9f9ec0fc6980adea8f302fa558506 (diff) | |
download | py2cairo-cab2c1295499f57247854e8635b77ca716fa9730.tar.gz |
Fix bug # 33013 - context.get_source().get_surface() fails with "SystemError:
NULL object passed to Py_BuildValue"
-rw-r--r-- | src/pattern.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pattern.c b/src/pattern.c index cebf0c9..a02ef1e 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -295,14 +295,14 @@ surface_pattern_get_filter (PycairoSurfacePattern *o) { static PyObject * surface_pattern_get_surface (PycairoSurfacePattern *o) { - /* + if (o->base != NULL) { + // surface_pattern was created using surface_pattern_new() + return Py_BuildValue("O", o->base); + } else { cairo_surface_t *surface; cairo_pattern_get_surface (o->pattern, &surface); - return PycairoSurface_FromSurface ( - cairo_surface_reference (surface), NULL); - */ - /* return the surface used to create the pattern */ - return Py_BuildValue("O", o->base); + return PycairoSurface_FromSurface(cairo_surface_reference (surface), NULL); + } } static PyObject * |