gimp r26296 - in branches/soc-2008-python: . plug-ins/pygimp



Author: larsc
Date: Wed Jul 23 22:19:58 2008
New Revision: 26296
URL: http://svn.gnome.org/viewvc/gimp?rev=26296&view=rev

Log:
2008-07-24  Lars-Peter Clausen  <lars metafoo de>

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


Modified:
   branches/soc-2008-python/ChangeLog
   branches/soc-2008-python/plug-ins/pygimp/pygimp-drawable.c

Modified: branches/soc-2008-python/plug-ins/pygimp/pygimp-drawable.c
==============================================================================
--- branches/soc-2008-python/plug-ins/pygimp/pygimp-drawable.c	(original)
+++ branches/soc-2008-python/plug-ins/pygimp/pygimp-drawable.c	Wed Jul 23 22:19:58 2008
@@ -1714,7 +1714,6 @@
     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 @@
 	return -1;
     }
 
+    self->drawable = gimp_drawable_get(self->ID);
+    
     return 0;
 }
 
@@ -2004,8 +2005,6 @@
 
     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 @@
 	return -1;
     }
 
+    self->drawable = gimp_drawable_get(self->ID);
+
     return 0;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]