Reset PSL internals at end of building each completion procedure#5732
Reset PSL internals at end of building each completion procedure#5732PaulWessel merged 1 commit intomasterfrom
Conversation
The way subplot tags and movie labels and progress indicators work is that the PostScript needed to place these items are written as a "completion" PostSCript function and then the function is called at the end of the subplot or plot. One tricky thing is that if you for instance change a color in a completion function, the next PSL function requesting the same color will think it was already set, but the function has not yet run, hence we fail to select the color. I had a partial sollution to this by resetting key internal parameters, but it was incomplete and failed in movie when several -L labels with the same color or pen outline were selected. This PR gathers all the resetting statements in a new function (gmtplot_reset_PSL) that is now called at the end of building a completion funciton. Tests still pass and my problem case also works.
|
Is this WIP? Because I am getting this message when I run gmt movie. However I don't see anything wrong in the mp4 or master frame. |
|
No, it was not WIP and I ran all the tests. However, I did not run all the animations (takes too long) except my new versions of 5 and an addition one with no problems. I will have to test your animation I think. |
|
As usual, no complains on macOS for your script. Do you get the error with no -F, i.e., just making a single PNG? RUn that with -Vd to see if you can learn when it tries to free, and ideally try to figure out which line that causes it. Could try to add |
|
Ok. Thanks. I will keep it in mind. The messages doesn't appear now. |
The way subplot tags and movie labels and progress indicators work is that the PostScript commands needed to place these items are stored as a "completion" PostScript procedure and then the procedure is called at the end of the subplot or the whole plot. One tricky thing is that if you for instance change a color in a completion procedure, the next PSL function requesting the same color in the main module will think it was already set, but the procedure has not yet run, hence we fail to set the color. I had a partial solution to this by resetting key internal parameters, but it was incomplete and failed in movie when several -L labels with the same color or pen outline were selected (the first label was correct, the next missed the same fill/pen). This PR gathers all the resetting statements in a new internal function (gmtplot_reset_PSL) that is now called at the end of building a completion procedure. Tests still pass and my problem case also works.