diff --git a/src/g_canvas.c b/src/g_canvas.c index 54e8b1adea377cf49293e42356aefde613d307b7..7f99df9670c21ed31f289f2e6596924b6dbaacc5 100644 --- a/src/g_canvas.c +++ b/src/g_canvas.c @@ -376,6 +376,7 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) 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) { @@ -393,12 +394,13 @@ t_canvas *canvas_new(void *dummy, t_symbol *sel, int argc, t_atom *argv) 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; + //new_rm->rm_canvas = x; t_canvas *owner = canvas_getcurrent(); t_symbol *s = &s_; diff --git a/src/g_canvas.h b/src/g_canvas.h index 22f1474d35f039311048942c37432ebd5181ae2d..f2c970315ed65505a16d5f0be186f127fc84e31e 100644 --- a/src/g_canvas.h +++ b/src/g_canvas.h @@ -45,6 +45,8 @@ extern "C" { instantiated inside canvas_new since the bug only affects new canvases/abstractions rather than individual objects. the queue is destructed in m_glob.c quit call (when pd exits) */ + +/* typedef struct _redundant_mem { int rm_what; @@ -54,7 +56,8 @@ typedef struct _redundant_mem t_redundant_mem *rm_start; t_redundant_mem *rm_end; - +*/ + /* --------------------- geometry ---------------------------- */ #define IOWIDTH 7 /* width of an inlet/outlet in pixels */ #define IOMIDDLE ((IOWIDTH-1)/2) diff --git a/src/g_numbox.c b/src/g_numbox.c index d99dc4b017ce7c961d66e06ff02cab0c25e336ad..ae7f9a18eb3fd53c050a1fc65996580daf1cf376 100644 --- a/src/g_numbox.c +++ b/src/g_numbox.c @@ -236,7 +236,7 @@ static void my_numbox_draw_new(t_my_numbox *x, t_glist *glist) x->x_gui.x_lcol, x, x); my_numbox_ftoa(x); sys_vgui(".x%lx.c create text %d %d -text {%s} -anchor w \ - -font {{%s} %d %s} -fill #%6.6x -tags {%lxNUMBER %lxNUM}\n", + -font {{%s} %d %s} -fill #%6.6x -tags {%lxNUMBER %lxNUM noscroll}\n", canvas, xpos+half+2, ypos+half+d, x->x_buf, x->x_gui.x_font, x->x_gui.x_fontsize, sys_fontweight, x->x_gui.x_fcol, x, x); diff --git a/src/m_memory.c b/src/m_memory.c index 7e0de12cbbe3a57be5ba198ce43605458d459225..1633fc5dfd4c3afd47cd6679c439dae0c41464e8 100644 --- a/src/m_memory.c +++ b/src/m_memory.c @@ -82,6 +82,7 @@ void freebytes(void *fatso, size_t nbytes) totalmem -= nbytes; #endif free(fatso); + fatso = NULL; } #ifdef DEBUGMEM diff --git a/src/m_pd.c b/src/m_pd.c index 7b5d8d2b3634deef645ef726351a770205866229..00e06c77366f99f5f41537f4e26d8e6ff7c3920b 100644 --- a/src/m_pd.c +++ b/src/m_pd.c @@ -36,7 +36,8 @@ t_pd *pd_new(t_class *c) 1 found a duplicate */ - int duplicate = -1; +/* + int duplicate = 0; //change to -1 to enable redundant_mem resizing int random_extra = 0; while (duplicate != 0) { @@ -76,6 +77,7 @@ t_pd *pd_new(t_class *c) x = (t_pd *)t_resizebytes(x, c->c_size+random_extra, c->c_size); } } +*/ x = (t_pd *)t_getbytes(c->c_size); *x = c; @@ -101,6 +103,7 @@ void pd_free(t_pd *x) binbuf_free(((t_object *)x)->ob_binbuf); } if (c->c_size) t_freebytes(x, c->c_size); + x = NULL; } void gobj_save(t_gobj *x, t_binbuf *b) diff --git a/src/m_pd.h b/src/m_pd.h index 965b68266fdd21e103edba65dc47e41806fb670a..05d0a4aef662816c5ea16353b909c4ae3178592c 100644 --- a/src/m_pd.h +++ b/src/m_pd.h @@ -11,7 +11,7 @@ extern "C" { #define PD_MAJOR_VERSION 0 #define PD_MINOR_VERSION 42 #define PD_BUGFIX_VERSION 5 -#define PD_TEST_VERSION "extended-l2ork-20110404" +#define PD_TEST_VERSION "extended-l2ork-20110413" /* old name for "MSW" flag -- we have to take it for the sake of many old "nmakefiles" for externs, which will define NT and not MSW */ diff --git a/src/s_inter.c b/src/s_inter.c index 40dc3ec41ace647a1f8205a63a765179aac01b10..d2226f3e69f732c8603d6bced232b9a88e63620b 100644 --- a/src/s_inter.c +++ b/src/s_inter.c @@ -1314,13 +1314,14 @@ void sys_bail(int n) void glob_quit(void *dummy) { /* deallocate rendundant memory (see g_canvas.c canvas_new and g_canvas.h for struct declaration */ +/* if (rm_start) { while (rm_start->rm_next) { t_redundant_mem *tmp = rm_start; rm_start = rm_start->rm_next; - /* we can also explicitly look for deallocating per-canvas settings here, if such proves necessary - to do so, look at rm_start->rm_canvas - */ + // we can also explicitly look for deallocating per-canvas settings here, if such proves necessary + // to do so, look at rm_start->rm_canvas + //fprintf(stderr,".x%lx\n", tmp->rm_canvas); t_freebytes(tmp, sizeof(*tmp)); //fprintf(stderr,"dealloc\n"); @@ -1330,6 +1331,7 @@ void glob_quit(void *dummy) //fprintf(stderr,"last dealloc\n"); } } +*/ sys_vgui("exit\n"); if (!sys_nogui) diff --git a/src/x_connective.c b/src/x_connective.c index 844687780607a4231ab5da701d8383988bdc1b56..e12d1a33b674065b814194f44ed8565772fd8709 100644 --- a/src/x_connective.c +++ b/src/x_connective.c @@ -971,6 +971,18 @@ static void *trigger_new(t_symbol *s, int argc, t_atom *argv) if (thistype == TR_SYMBOL) { if (strlen(ap->a_w.w_symbol->s_name) == 1) c = ap->a_w.w_symbol->s_name[0]; + else if (strcmp(ap->a_w.w_symbol->s_name, "anything") == 0) + c = 'a'; + else if (strcmp(ap->a_w.w_symbol->s_name, "bang") == 0) + c = 'b'; + else if (strcmp(ap->a_w.w_symbol->s_name, "float") == 0) + c = 'f'; + else if (strcmp(ap->a_w.w_symbol->s_name, "list") == 0) + c = 'l'; + else if (strcmp(ap->a_w.w_symbol->s_name, "pointer") == 0) + c = 'p'; + else if (strcmp(ap->a_w.w_symbol->s_name, "symbol") == 0) + c = 's'; else c = 'S'; } else if (thistype == TR_FLOAT) @@ -1059,7 +1071,7 @@ static void trigger_anything(t_trigger *x, t_symbol *s, int argc, t_atom *argv) { outlet_symbol(u->u_outlet, &u->u_sym); } - else pd_error(x, "trigger: can only convert 's' to 'b' or 'a'"); + else pd_error(x, "trigger: can only convert 'a' to 'b' or 'a'"); } }