From: Alan W. I. <ir...@be...> - 2002-12-10 08:08:34
|
Apparently Joao has sequences of plinit, plend, plinit in his "x" octave examples which violated an assumption I had made that a call to plend was the last possible use of libplplot in a programme. With that assumption I could release libltdl memory resources in plend. I have now fixed this so the libtldl memory resources are never released. Now on my system all of Joao's "x" examples run and all his "p" examples also run except for p7 and p15. Apparently Joao knows what the p7 trouble is so that leaves only p15 as the last octave example where there is unexplained trouble. This is a nice step forward, but nevertheless, I am now having second thoughts about this "fix" because I like the idea of plend being the last possible call to the libplplot library so we could release all dynamic driver (and in my case the libltdl) memory resources there. Those are the memory resources that are allocated when the library is initialized so this is the only possible place to release the resources again. But that cannot be done if our users are free to call plinit again after plend is called. I would like to hear the developer's thoughts (especially Joao's thoughts) on this topic. For example, there should be a way for the octave x examples to work using pladv without having to call any libplplot function after plend is called at the very end of the x plots. I assert that because all the normal x examples in C are done that way so I assume octave can follow that model. Alternatively, there is the python or tcl model where plinit is called once before all examples are plotted, every example restores initial values (colour maps) when its part of the plotting is done, and plend is called once at the end (see xw??.py and pythondemos.tcl to see how this approach all fits together). Could that "python" approach work for octave, Joao? Alan email: ir...@be... phone: 250-727-2902 FAX: 250-721-7715 snail-mail: Dr. Alan W. Irwin Department of Physics and Astronomy, University of Victoria, P.O. Box 3055, Victoria, British Columbia, Canada, V8W 3P6 __________________________ Linux-powered astrophysics __________________________ |