In the function `musmon', the line corfile_rm(&(csound->scorestr)); is to delete, because the precedent `scsortstr' function calls `sfree' that contains corfile_rm(&(csound->scorestr)); Besides, the second argument of `scsortstr', CORFIL *scin, is unused in the definition of the function, therefore it is to rewrite. These are some fixed memory leaks: ==26906== 24,808 bytes in 1 blocks are definitely lost in loss record 19 of 20 ==26906== at 0x4C27EBB: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==26906== by 0x76DAE5E: widget_init (in /usr/local/lib/csound/plugins/libwidgets.so) ==26906== by 0x76DAB82: csoundModuleInit (in /usr/local/lib/csound/plugins/libwidgets.so) ==26906== by 0x5D249B2: csoundInitModule (in /usr/local/lib/libcsound.so.5.2) ==26906== by 0x5D24B88: csoundInitModules (in /usr/local/lib/libcsound.so.5.2) ==26906== by 0x5D2B247: csoundCompile (in /usr/local/lib/libcsound.so.5.2) ==26906== by 0x402053: ??? (in /usr/local/bin/csound) ==26906== by 0x6307B6C: (below main) (in /lib64/libc-2.11.1.so) ==27291== 262,560 (416 direct, 262,144 indirect) bytes in 4 blocks are definitely lost in loss record 354 of 354 ==27291== at 0x4C2720B: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==27291== by 0x76D8ECF: add_graph(CSOUND_*, windat_*) (in /usr/local/lib/csound/plugins/libwidgets.so) ==27291== by 0x76D95FE: DrawGraph_FLTK (in /usr/local/lib/csound/plugins/libwidgets.so) ==27291== by 0x5CB06B4: display (in /usr/local/lib/libcsound.so.5.2) ==27291== by 0x5C70DB4: ftresdisp (in /usr/local/lib/libcsound.so.5.2) ==27291== by 0x5C6812F: hfgens (in /usr/local/lib/libcsound.so.5.2) ==27291== by 0x5C82015: process_score_event (in /usr/local/lib/libcsound.so.5.2) ==27291== by 0x5C8294E: sensevents (in /usr/local/lib/libcsound.so.5.2) ==27291== by 0x5D26CC2: csoundPerform (in /usr/local/lib/libcsound.so.5.2) ==27291== by 0x40206B: ??? (in /usr/local/bin/csound) ==27291== by 0x6307B6C: (below main) (in /lib64/libc-2.11.1.so) diff -ur csound5~/Engine/musmon.c csound5/Engine/musmon.c --- csound5~/Engine/musmon.c 2011-11-29 11:10:24.000000000 +0100 +++ csound5/Engine/musmon.c 2011-11-29 11:11:28.000000000 +0100 @@ -305,7 +305,6 @@ csound->Message(csound, Str("sorting cscore.out ..\n")); csound->scorestr = copy_to_corefile("cscore.srt"); scsortstr(csound, csound->scorestr); /* call the sorter again */ - corfile_rm(&(csound->scorestr)); fclose(csound->scfp); csound->scfp = NULL; fputs(corfile_body(csound->scstr), csound->oscfp); fclose(csound->oscfp); csound->oscfp = NULL; diff -ur csound5~/InOut/FL_graph.cpp csound5/InOut/FL_graph.cpp --- csound5~/InOut/FL_graph.cpp 2011-11-29 11:10:24.000000000 +0100 +++ csound5/InOut/FL_graph.cpp 2011-11-29 11:31:21.000000000 +0100 @@ -317,7 +317,7 @@ { for (int i = 0; i < NUMOFWINDOWS; i++) { WINDAT *n = (WINDAT*) ST(menu)[i].user_data_; - if (n != NULL && n->windid == m) { + if (n != NULL && ((uintptr_t) n == m || n->windid == m)) { free(n->fdata); free(n); free((void*) ST(menu)[i].text); diff -ur csound5~/InOut/winFLTK.c csound5/InOut/winFLTK.c --- csound5~/InOut/winFLTK.c 2011-11-29 11:10:24.000000000 +0100 +++ csound5/InOut/winFLTK.c 2011-11-29 11:13:34.000000000 +0100 @@ -79,8 +79,7 @@ initFlags = 1; } fltkFlags = getFLTKFlagsPtr(csound); - if (csound->oparms->displays && - ((*fltkFlags) & 2) == 0 && + if (((*fltkFlags) & 2) == 0 && !(csound->oparms->graphsoff || csound->oparms->postscript)) { #ifdef LINUX Display *dpy = XOpenDisplay(NULL); @@ -143,7 +142,8 @@ } } - widget_init(csound); + if (!(csound->oparms->graphsoff || csound->oparms->postscript)) + widget_init(csound); return 0; } I have added `(uintptr_t) n == m' in `kill_graph' otherwise `ExitGraph_FLTK' doesn't work. Checked with fltk, -d, -g and -G (gnu/linux) tito ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net