Thanks, I can confirm that this fixes my segmentation fault :-) - Torquil
On Friday 01 February 2008, Werner Smekal wrote: > Hi Andrew and Torquil, > > I made the decision to copy the whole (actually the part of the buffer > which contains information) buffer to a new memory buffer. Reason is, > that there is no obligation to close the stream right after you saved > the file. If the programmer decides to work on with both streams, both > streams write into the same buffer. Since nowadays memory is not that > problem anymore, I decided to copy the buffer. I couldn't test it > actually since on Windows there was no segmentation fault, but at least > the new version still compiles and runs on Windows. Could anybody > (Torquil?) test it, if the changes solve the problems? > > Regards, > Werner > > > I've just been looking at this bug too. We need the buffer - this is > > what contains the copy of the plot commands for plreplot. The question > > is should the copied stream have a copy of the buffer, or the actual > > buffer. The old file buffer code seems to have used the actual file - so > > by analogy we should have the actual buffer. If this is the case, then > > we to have a reference counter for the buffer so we only free it once > > all streams no longer reference it. The original buffer code goes way > > back before my time with plplot. Does anyone still remember the original > > intentions? Alan might recall. > > > > I'll leave any fix to you so we don't duplicate work. > > > > Andrew > > > > P.S. I notice plstrm.h contains a plBufOwner variable to mark which > > stream actually owns a buffer. Unfortunately this isn't used. It also > > doesn't replace the reference counter because it doesn't stop a copy > > accessing the buffer after it has been free'd. > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > Plplot-devel mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/plplot-devel ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Plplot-general mailing list Plplot-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-general