[Gridflow-cvs] [svn] commit: r5226 - /trunk/src/classes2.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Sun Mar 28 12:10:27 EDT 2010


Author: matju
Date: Sun Mar 28 12:10:27 2010
New Revision: 5226

Log:
fix crash in [gf/canvas_isselected]

Modified:
    trunk/src/classes2.cxx

Modified: trunk/src/classes2.cxx
==============================================================================
--- trunk/src/classes2.cxx (original)
+++ trunk/src/classes2.cxx Sun Mar 28 12:10:27 2010
@@ -1103,7 +1103,7 @@
 	((t_text *)m)->te_xpix = atom_getintarg(0,argc,argv);
 	((t_text *)m)->te_ypix = atom_getintarg(1,argc,argv);
 	t_canvas *granny = m->gl_owner;
-	if (!granny) RAISE("no such canvas");
+	if (!granny) RAISE("chosen canvas is not in any canvas");
 #ifdef DESIRE
 	gobj_changed(m);
 #else
@@ -1119,10 +1119,15 @@
 	\decl 0 bang () {MOM; outlet_float(outlets[0],m->gl_edit);}
 };
 \end class {install("gf/canvas_edit_mode",1,1);}
-\class GFCanvasIsSelected : FObject { /* contributed by "rumence" of Slovakia, on IRC */
+\class GFCanvasIsSelected : FObject {
+	/* contributed by "rumence" of Slovakia, on IRC */
+	/* bugfix by matju */
 	int n;
 	\constructor (int n) {this->n=n;}
-	\decl 0 bang () {MOM; outlet_float(outlets[0],(t_float)glist_isselected(m->gl_owner,(t_gobj *)m));}
+	\decl 0 bang () {MOM;
+		if (!m->gl_owner) RAISE("chosen canvas is not in any canvas");
+		outlet_float(outlets[0],(t_float)glist_isselected(m->gl_owner,(t_gobj *)m));
+	}
 };
 \end class {install("gf/canvas_isselected",1,1);}
 extern "C" void canvas_setgraph(t_glist *x, int flag, int nogoprect);



More information about the Gridflow-cvs mailing list