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

Reply via email to