Commit 9a42fca7 authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

Cleaning up code plus attempts at improving script-based dynamic...

Cleaning up code plus attempts at improving script-based dynamic closing/opening of patches (as per Jonathan's request).
parent 273e8fd9
......@@ -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;
......
......@@ -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)
......
......@@ -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]} {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment