As I can see, whenever I save&publish my project, Python scripts get reinitialized (both shared and project ones) - if I put a
print "init" just at the beginning, that line is executed again after save&publish.
My problem is as follows: I use a couple of
global Python variables to save references to java objects from a JAR library I developed. If I save&publish my project I see that those variable are reinitialized to
None, but the resources they allocated have not been freed! Moreover if I dump the heap of the client process with
jmap, I see that the old references are still there. To solve the problem, whenever I save&publish the project, I need to ask my customer to restart the Ignition client - which is not that nice!
Is there any possibility to listen to save&publish or whatever, so that I can dispose the objects referenced by the global variables and then have a clean restart? Or do you have a cleverer solution where to put the object references I now save in
global Python variables?
Thanks in advance, regards
Ignition version: 7.9.9 (b2018081621)