-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 2013-12-18 12:22, puredata@11h11.com wrote:
Is there a way to do something (let's say close a file, kill a subprocess etc...) before quitting pd (meaning Ctrl+Q or File - Quit)?
there is [closebang], which will send out a bang before a patch is "closed" (Ctrl-W). if you are familiar to writing externals, it's an equivalent of the "free"-method. unfortunately [closebang] cannot be implemented as a pure external (as it requires some changes to Pd's core infrastructure), and it has never been included with Pd-vanilla. there is a patch pending at sourceforge [1]. afaik [closebang] and it's cousin [initbang] are included in Pd-extended.
but this is only half of the truth...when *quitting* Pd (instead of closing a single top-level-patch, or deleting an object), for some obscure reasons Pd does *not* call the free-methods of it's objects, so (afair) [closebang] doesn't work either.
luckily, there is a fix for this [2], so [closebang] might work. unfortunately, this has never been included in Pd-vanilla. afaik it has been included in Pd-extended.
admsr IOhannes
[1] https://sourceforge.net/p/pure-data/patches/93/ [2] https://sourceforge.net/p/pure-data/patches/82/