Hi Werner,

The changes you made also fix my problems with the segmentation violation.

Thanks,
Hans Rijneke

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Werner
Smekal
Sent: Friday, February 01, 2008 22:51
To: plplot_general; PLplot development list
Subject: Re: [Plplot-general] [Plplot-devel] Segfault


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


-- 
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: [EMAIL PROTECTED]
web:   http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office)
        +43-(0)1-58801-13469 (laboratory)
fax:   +43-(0)1-58801-13499

-------------------------------------------------------------------------
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



-------------------------------------------------------------------------
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

Reply via email to