[PD-dev] allow only one instance of external object

best boy ladataxi at hotmail.de
Sun Mar 23 21:07:35 CET 2008


hi
yes, it's for an external i'm writing.
i tried the global counter variable thing you recommended and it works, except for
when the first instance is duplicated, or copy/pasted in a patcher. this crashes pd.

do you, or anyone else, know of a working example of the global counter variable thing?

thanks
olli

> Date: Sun, 23 Mar 2008 10:43:36 +0000
> From: claudiusmaximus at goto10.org
> To: ladataxi at hotmail.de
> CC: pd-dev at iem.at
> Subject: Re: [PD-dev] allow only one instance of external object
> 
> best boy wrote:
> > hi
> > is there a way to keep track of the number of opened instances of an 
> > external?
> 
> Is this an external you are writing?  Then yes.  Otherwise there's weird 
> tricks you can probably do to keep track, but not control.
> 
> > if so, can anyone point me to an example object?
> 
> Just have a global counter variable that you initialise to 0 in 
> foo_setup(), and in foo_new() you increment it, and in foo_free() you 
> decrement it.
> 
> > thanks
> > olli
> 
> Claude
> -- 
> http://claudiusmaximus.goto10.org
> 

_________________________________________________________________
Testen Sie Live.com - das Zentrum Ihrer Online-Welt, das Sie mit aktuellen Nachrichten, Sport- und Wetterinfos und vielem mehr versorgt.
http://www.live.com/getstarted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20080324/2d62ff99/attachment.htm>


More information about the Pd-dev mailing list