Begin forwarded message:
> From: Werner Smekal <[EMAIL PROTECTED]> > Date: 29. Februar 2008 07:59:47 GMT+01:00 > To: Jonathan Woithe <[EMAIL PROTECTED]> > Subject: Re: [Plplot-devel] Multiple plsetopt() calls before plend() > > Hi Jonathan, > > there is also a problem in the plsetopts() code when calling device > options, that when you call this function twice it forgets about the > first call - and this may have to do what you are describing. I'll > have a look into the code and see if we really have a memory leak > and if that also solves the other problem, > > thanks, > Werner > > On 29.02.2008, at 01:48, Jonathan Woithe wrote: > >> Hi guys >> >> I have a question regarding the calling of plsetopts() multiple times >> to set device options without any intervening plend() call. From a >> brief look at the plplot source code it seems that doing this may >> cause a >> memory leak. >> >> Calling plsetopts() ends up at c_plparseopts() via c_plsetopt() and >> plSetOpt() (all in src/plargs.c). Towards the top of this function >> we do >> >> drv_opt.option = drv_opt.value = NULL; >> drv_opt.next = NULL; >> >> drv_opt is created during option parsing but the only place I could >> find >> that the associated memory is freed is in plP_FreeDrvOpts() which >> itself is >> only called via plend(). According to this analysis, multiple >> calls to >> plsetopts() without plend() in between will therefore leak memory. >> >> So, have I missed something here? >> >> The context is that I would like to call plsetopts() with different >> device >> options for different streams without doing plend() between them. >> Logically >> this should be ok but the code may not be up to it. >> >> Comments? >> >> Regards >> jonathan >> >> ------------------------------------------------------------------------- >> 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 >> Plplot-devel@lists.sourceforge.net >> 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 > -- 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-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel