aboutsummaryrefslogtreecommitdiff
path: root/packages/patches/fix_crash_on_sending_obj-g_text-0.39.2.patch
blob: 6952900af7bda3ef17dd362ea88b78c3404466c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Index: g_text.c
===================================================================
RCS file: /cvsroot/pure-data/pd/src/g_text.c,v
retrieving revision 1.13
diff -u -r1.13 g_text.c
--- g_text.c	11 Aug 2006 20:09:07 -0000	1.13
+++ g_text.c	30 Aug 2006 15:33:53 -0000
@@ -145,8 +145,11 @@
         canvas_objtext(gl, atom_getintarg(0, argc, argv),
             atom_getintarg(1, argc, argv), 0, b);
     }
-    else
-    {
+    else if(!glist_isvisible(gl)){
+      /* JMZ: not a good idea to go into interactive mode in a closed canvas... */
+      post("unable to create stub object in closed canvas!");
+      return;
+    } else {
         t_binbuf *b = binbuf_new();
         int xpix, ypix;
         pd_vmess(&gl->gl_pd, gensym("editmode"), "i", 1);
@@ -413,6 +416,11 @@
     else
     {
         int xpix, ypix;
+        /* JMZ: not a good idea to go into interactive mode in a closed canvas... */
+        if(!glist_isvisible(gl)){
+          post("unable to create stub message in closed canvas!");
+          return;
+        }
         pd_vmess(&gl->gl_pd, gensym("editmode"), "i", 1);
         glist_noselect(gl);
         glist_getnextxy(gl, &xpix, &ypix);