question about zombie Views in ViewList

dmccallie

Member
Hello all,
I'm learning to write Pixinsight scripts, and I have a few questions.
To start with, when I load a view pick list to let the user select their target, with code like this:

Code:
   this.targetImage_ViewList = new ViewList( this );
   this.targetImage_ViewList.reload()
   this.targetImage_ViewList.scaledMinWidth = 300;
   this.targetImage_ViewList.getMainViews()

... I often see all sorts of "zombie" views in the ViewLIst() left over from previous test runs of my code.
The older views were all "forceClose()" and even "Purge()" in code, and of course they are not showing on the screen.

Is there any way to get ride of these no-longer-needed images so they don't clutter the viewlist?
What is the best way to get rid of a temporary view that is no longer needed?

Thanks!
David McCallie
 
Hello all,
I'm learning to write Pixinsight scripts, and I have a few questions.
To start with, when I load a view pick list to let the user select their target, with code like this:

Code:
   this.targetImage_ViewList = new ViewList( this );
   this.targetImage_ViewList.reload()
   this.targetImage_ViewList.scaledMinWidth = 300;
   this.targetImage_ViewList.getMainViews()

... I often see all sorts of "zombie" views in the ViewLIst() left over from previous test runs of my code.
The older views were all "forceClose()" and even "Purge()" in code, and of course they are not showing on the screen.

Is there any way to get ride of these no-longer-needed images so they don't clutter the viewlist?
What is the best way to get rid of a temporary view that is no longer needed?

Thanks!
David McCallie
Hi @dmccallie,

In my experience, invisible windows are always left by the code, so the first suggestion is to triple-check your code and find where you're not closing some windows that have been created.
The list of windows, including the not visible ones, can also be inspected by the dropdown view list in the bottom-left of the PI interface:

1662784509259.png

If something remains alive after the script execution, it should be listed here. Maybe you can assign informative windows IDs that help to diagnostic which windows remains alive and track back their lifecycle in the code.
 
You are (of course) correct.
I had a subtle bug and my cleanup routine was never being called, which left a lot of windows lying around.
Fixed, thank you.

--david
 
Back
Top