Andrew Ross <[EMAIL PROTECTED]> writes:

> I've just fixed a bug in plbuf.c to do with memory allocation which 
> caused example 20 to crash with a segmentation fault. There was also
> an associated memory leak. Looking back at various old versions I have
> compiled up here this bug must have been introduced with the changes
> to memory buffers in June. 
>

Thanks for catching my bugs.  The reason I didn't free the memory in
plbuf_tidy() was to facilitate reuse of the memory.  The plbuf_bop
routine calls plbuf_tidy() and in my application I call plbuf_bop()
frequently.  The constant malloc/free calls will kill performance and
fragment the heap.

In plbuf_bop I set pls->plbuf_top = 0, which has the same effect as
discarding the contents of the buffer.  My recommendation is to go to
the previous version of plbuf_tidy and free the memory via a call in
c_plend.  I can submit a patch if this is an acceptable solution.

cheers
-jd


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to