[PD] question about external free functions

Rich E reakinator at gmail.com
Wed Dec 9 01:43:41 CET 2009


You have a point, pd crashing some time or another is inevitable, and even
'force quitting' the example app given to me by a the Wacom guys has the
same problem as I am dealing with - with one difference in that restarting
their app will reset the driver to its original state.  I must still be
missing something in my attempts.

One thing I still wonder about; why is shutting pd via Ctrl-q any different
than closing a patch (causing an exit() before destroying the patches)?
[closebang]'s won't work either, I suppose, among other things like what I
am trying to do.

On Sat, Dec 5, 2009 at 4:26 AM, Mathieu Bouchard <matju at artengine.ca> wrote:

> On Tue, 1 Dec 2009, Rich E wrote:
>
>  Okay, so Ctrl-Q skips all free functions on purpose.  If I am
>> understanding correctly, I need to register my cleanup function with atexit
>> on a function of type void _function_(void), but that means I don't have
>> access to any of my object's member variables.
>>
>
> one workaround is to make a global map<MyClass,int> where int is a dummy
> (unfortunately, void is not accepted as an argument of that type-pattern).
>
>
>  In the case of flext, the external class would need to be declared as
>> static in order for its destructor to be called before shutting down - do
>> you know if this is right, or possible, Thomas or anyone else knowing about
>> flext/C++ and pd?
>>
>
> This doesn't sound right. Note that there are some things that apply to
> objects that are directly global, and don't apply when the global variables
> are just pointers. I almost always use the latter because the former is a
> pain in the ass. (any static variable counts as global in this case, because
> they're essentially a kind of hidden global).
>
>
>  The reason I need this is because I am messing around with disconnecting
>> the wacom events from controlling the tablet, which takes some calls that
>> change the driver's settings.  If I cannot turn the settings back before the
>> program stops, they are permanently screwed until I restart the
>> driver/computer.  At least, this is all I can tell so far.
>>
>
> ow. so what can it do in case of segmentation fault or other crash of
> Pd?... what happens if you bang a naked [until] while you use your wacom
> thing?
>
>
>  _ _ __ ___ _____ ________ _____________ _____________________ ...
> | Mathieu Bouchard, Montréal, Québec. téléphone: +1.514.383.3801
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20091209/c91b1b38/attachment.htm>


More information about the Pd-list mailing list