Python libmm problems

Aleksander Morgado aleksander at aleksander.es
Fri Sep 15 16:04:13 UTC 2017


>> > Though this is coming together nicely now, I don't need the script to run forever once it's done its stuff. Is there a way send a HUP/TERM to itself?
>>
>> You can always quit the GLib main loop and exit cleanly.
>>
>
> Oh.... yeah, sorry.... that was probably a bit of an obvious question!
>
> But, how much might I need to explicitly clean up, or will the quit (and/or python interpreter) do 'everything'?  (Dan mentioned "you get to make sure you clean up your event handlers when you're not using them :)")

That last statement about removing event handlers when no longer using
them doesn't really apply for when you're going to quit the program :)
It all depends how much "cleanup" you want to do; I usually try to do
a full cleanup when a program is exiting cleanly, as that actually
helps finding memory leaks, but at the end of the day the program is
going to end and the process and all resources it was using will be
claimed by the operating system.

You definitely want to remove event handlers when the object they
refer to is no longer valid, or when you actually don't need the event
handlers any more.

-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list