From: Jonathan W. <jw...@ph...> - 2008-02-29 00:49:01
|
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 |