Initialise self->drawable in lay_init and chn_init

2008-07-24  Lars-Peter Clausen  <lars@metafoo.de>

	* plug-ins/pygimp/pygimp-drawable.c: Initialise self->drawable in lay_init
	and chn_init

svn path=/branches/soc-2008-python/; revision=26296
This commit is contained in:
Lars-Peter Clausen 2008-07-23 22:19:58 +00:00 committed by Lars-Peter Clausen
parent ee727921bb
commit 8b1b5015ea
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2008-07-24 Lars-Peter Clausen <lars@metafoo.de>
* plug-ins/pygimp/pygimp-drawable.c: Initialise self->drawable in lay_init
and chn_init
2008-07-23 Lars-Peter Clausen <lars@metafoo.de>
* plug-ins/pygimp/gimpui.override: Wrapped GimpAspectpreview,

View File

@ -1714,7 +1714,6 @@ lay_init(PyGimpLayer *self, PyObject *args, PyObject *kwargs)
self->ID = gimp_layer_new(img->ID, name, width, height,
type, opacity, mode);
self->drawable = NULL;
if (self->ID < 0) {
PyErr_Format(pygimp_error,
@ -1724,6 +1723,8 @@ lay_init(PyGimpLayer *self, PyObject *args, PyObject *kwargs)
return -1;
}
self->drawable = gimp_drawable_get(self->ID);
return 0;
}
@ -2004,8 +2005,6 @@ chn_init(PyGimpChannel *self, PyObject *args, PyObject *kwargs)
self->ID = gimp_channel_new(img->ID, name, width, height, opacity, rgb);
self->drawable = NULL;
if (self->ID < 0) {
PyErr_Format(pygimp_error,
"could not create %dx%d channel '%s' on image (ID %d)",
@ -2013,6 +2012,8 @@ chn_init(PyGimpChannel *self, PyObject *args, PyObject *kwargs)
return -1;
}
self->drawable = gimp_drawable_get(self->ID);
return 0;
}