Thank you mikael and JonB for the help.
You sure you have update_interval set?
Yes. I have:
self.update_interval = 1.0
in my derived class's
It likely I did something to break code that was working, but I don't see anything wrong. I'll debug my application - if this works for others, then I'm sure I introduced a bug somewhere. It's odd though, because I only made two very small changes and then updated the OS.
Next time, before I upgrade the OS, I'll test before to make sure it's the OS that breaks code, and not my code changes.
@JonB - In every case described below, I am starting the application using a shortcut .
When my app calls os._exit(0), I see no windows. If I click the home button, I see two windows in the background.
I can run my application by clicking on one of the windows.
If I use os._exit(0), I still see two windows, and just as before, I can still restart my app by clicking on one of the windows. (It's the mostly all white (console?) window,- my application sets a black background which shows in the other window). Note, I call console.exit(), so I though I closed the console window.
I am also still able to reopen Pythonista using the Pythonista icon while that other window is present.
I must not be cleaning something up?
cvp - That is what I meant. When os.abort() or os._exit(0) is called, the app shuts down, the home screen shows, but, depending on the Pythonista app, there are one or two windows running in the background.
It's not a big deal. I can launch Pythonista again without closing these windows.
@ccc - I did some searching, and apparently Apple discourages calling exit(0) in objective C to close an app, because that appears similar to an app crashing.
My issue is that when I use a shortcut URL to launch my GUI application, when I hit the home button to close the app, there are two windows to close, not just one like most (all?) other apps.
Is there a way I can make my app so that it does not show the second window when I start the app this way?
I am using a uiView-derived window in my app.
JonB - Thanks for the reply. Unfortunately, os.abort() appears to do the same thing as os.exit(0). The app goes away, but the console window, and one other window, presumably the main Pythonista window, are running in the background and have to be closed separately.
I'm running the latest Pythonista beta on an iPhone 6s running IOS 11.2.1
I'm not complaining. Pythonista is great the way it is. That would be a nice feature though.
lukaskollmer posted a link to code to get memory statistics in this topic:
JonB has another link to code to get memory memory statistics in the same topic. (Although, the current ending comment JonB put there is, "Looks like this code does not work properly on 64 bit... i suspect the structure is not sized correctly." - but if the first code doesn't help, you might want to use JonB's code as a starting point.
I am not sure any of that will help you detect a leak though.
Python uses reference-counted objects and garbage collection. There might be a way to force garbage collection, but even if "del" as used to delete an object, and there was some special way to force immediate garbage collection, while the memory will be freed so that Pythonista can reallocate it for another purpose, the memory won't necessarily be freed to the operating system.
You could use "multiprocessing" and do memory intensive work in a subprocess, and when that process closes, the memory will be returned to the operating system.
Perhaps someone more familiar with Pythonista's internals can give a better answer. My guess is that what I wrote is correct.