diff --git a/src/g_canvas.c b/src/g_canvas.c index 4c1e5cd21605cdb02cf005bfa3eba7b14fead83d..edc7e5f64b1fd12997fcc7c4c4088a70da77327d 100644 --- a/src/g_canvas.c +++ b/src/g_canvas.c @@ -347,37 +347,7 @@ void glist_init(t_glist *x) tells us which.) */ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) { - /* first alloc one byte or redundant memory to prevent creation of objects with the same "name" - which leads to double-action invoked from every single action and eventually possible crashes - - we keep a list of these redundant allocations and destroy them when pd quits */ - //if (x->gl_owner && x->gl_env) { -/* - t_redundant_mem *new_rm = (t_redundant_mem *)t_getbytes(sizeof(*new_rm)); - new_rm->rm_what = (int)getbytes(1); - if (rm_start == NULL) { - //fprintf(stderr,"first allocation\n"); - rm_start = new_rm; - rm_end = new_rm; - } - else if (rm_start == rm_end) { - //fprintf(stderr,"second allocation\n"); - rm_end = new_rm; - rm_start->rm_next = rm_end; - } - else { - //fprintf(stderr,"allocation\n"); - rm_end->rm_next = new_rm; - rm_end = new_rm; - } -*/ - //} - t_canvas *x = (t_canvas *)pd_new(canvas_class); - - /* now that we've created a new canvas, add canvas info to the new_rm */ - //new_rm->rm_canvas = x; - t_canvas *owner = canvas_getcurrent(); t_symbol *s = &s_; int vis = 0, width = GLIST_DEFCANVASWIDTH, height = GLIST_DEFCANVASHEIGHT; diff --git a/src/g_editor.c b/src/g_editor.c index 58fc56f318b7a0da72bfaea2227cae65157a8e8d..58f9e178bad91c6830698d2b9f34ba31ce4ec183 100644 --- a/src/g_editor.c +++ b/src/g_editor.c @@ -3030,7 +3030,10 @@ void glob_verifyquit(void *dummy, t_floatarg f) void canvas_dofree(t_gobj *dummy, t_glist *x) { + //int dspstate = canvas_suspend_dsp(); + //sys_flushqueue(); pd_free(&x->gl_pd); + //canvas_resume_dsp(dspstate); } /* close a window (or possibly quit Pd), checking for dirty flags. @@ -3082,10 +3085,13 @@ void canvas_menuclose(t_canvas *x, t_floatarg fforce) //clock_delay(x->gl_destroy, 0); } else if (force == 1) { - //pd_free(&x->gl_pd); //sys_vgui("pd {.x%lx menuclose -1;}\n", x); //sys_vgui("menu_close .x%lx\n", x); sys_queuegui(x, x, canvas_dofree); + //canvas_vis(x, 0); + //canvas_free(x); + //pd_free(&x->gl_pd); + //fprintf(stderr,"pd_free queued------------\n"); //clock_delay(x->gl_destroy, 0); } else if (force == 2) diff --git a/src/pd.tk b/src/pd.tk index d756782f2cf38cfa207b494d9253375ed0af4472..8912f147dc7d3591827c0e27bae544c9079725e3 100644 --- a/src/pd.tk +++ b/src/pd.tk @@ -967,7 +967,7 @@ proc pdtk_set_current_dir {path_and_filename} { proc open_file {filename} { global pd_opendir pd_guidir pd_nt - puts stderr open_file + #puts stderr open_file set directory [file dirname $filename] set basename [file tail $filename] if {[regexp -nocase -- "\.(pat|mxb|help)$" $basename]} {