btw, in 2 of 3 branches in the canvas_cut() check whether x->gl_editor is NULL or not. the 3rd branch is the one that crashes...
attached is a patch that at least fixes this. miller, could you include this?
however, my great wish would be that one could select (and cut) objects in a closed window....
fgmdsf IOhannes
SourceForge.net wrote:
Bugs item #1654666, was opened at 2007-02-08 00:08 Message generated for change (Settings changed) made by zmoelnig You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=478070&aid=1654666...
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: puredata Group: v0.40.2 Status: Open Resolution: None
Priority: 7
Private: No Submitted By: Matteo Sisti Sette (sistisette)
Assigned to: Miller Puckette (millerpuckette)
Summary: sending a cut message to an "invisible" subpatch makes crash
Initial Comment: If you have a subpatch, and send a "cut" message to it when it is not in "visible" state (i.e. it is not open), pd crashes.
This may happen when using scripting, if for example you send a "find foo" message followed by a "cut" message. If the object does not exist (and the subpatch hasn't been made explicitly visible), the cut message will reach the canvas when it is invisible.
See the attached example.
Tested on 0.40.2 on Windows XP.
Matteo Sisti Sette
matteo dot sistisette at email dot it
Comment By: IOhannes m zmlnig (zmoelnig)
Date: 2009-01-28 19:09
Message: raised priority since this bothers me right now!
miller: any chance to get selection/copy/paste/... to work with closed patches?
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=478070&aid=1654666...
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
Index: g_editor.c =================================================================== --- g_editor.c (Revision 10558) +++ g_editor.c (Arbeitskopie) @@ -1939,7 +1939,7 @@ static t_binbuf *canvas_findbuf; int binbuf_match(t_binbuf *inbuf, t_binbuf *searchbuf, int wholeword);
- /* find an atom or string of atoms */ +/* find an atom or string of atoms */ static int canvas_dofind(t_canvas *x, int *myindex1p) { t_gobj *y; @@ -2251,7 +2251,8 @@
static void canvas_cut(t_canvas *x) { - if (x->gl_editor && x->gl_editor->e_selectedline) + if(x->gl_editor) { + if (x->gl_editor->e_selectedline) canvas_clearline(x); else if (x->gl_editor->e_textedfor) { @@ -2264,7 +2265,7 @@ rtext_key(x->gl_editor->e_textedfor, 127, &s_); canvas_dirty(x, 1); } - else if (x->gl_editor && x->gl_editor->e_selection) + else if (x->gl_editor->e_selection) { canvas_setundo(x, canvas_undo_cut, canvas_undo_set_cut(x, UCUT_CUT), "cut"); @@ -2272,6 +2273,9 @@ canvas_doclear(x); sys_vgui("pdtk_canvas_getscroll .x%lx.c\n", x); } + } else { + bug("no editor available"); + } }
static int paste_onset;