On Mar 25, 2014, at 6:00 AM, pd-dev-request@iem.at wrote:
From: Kjetil Matheussen k.s.matheussen@gmail.com Subject: Re: [PD-dev] Destructor in external classes Date: March 24, 2014 at 12:32:00 PM CDT To: Antoine Villeret antoine.villeret@gmail.com Cc: IOhannes m zmölnig zmoelnig@iem.at, pd-dev List pd-dev@iem.at Reply-To: k.s.matheussen@notam02.no
On Mon, Mar 24, 2014 at 2:56 PM, Antoine Villeret antoine.villeret@gmail.com wrote:
hello,
the free method seems to be called when the object is deleted from the canvas.
is there a similar method called on Pd quit ? I'm asking that because I'm rewriting a pix_openni2 object and to free the openni context i have to call a shutdown() function on quit and not on object deletion
How about 'atexit'?
Why not keep track of the number of open openni objects, then call shutdown when the last one is released?
-------- Dan Wilcox @danomatika danomatika.com robotcowboy.com
for now the OpenNI init() function is called from obj_setupCallback which is called only once and if I call shutdown() I need to recall init() on new instance creation
so yes it could be a workaround but having a onQuit() method will make my work easier :-)
+ a
-- do it yourself http://antoine.villeret.free.fr
2014-03-25 15:50 GMT+01:00 Dan Wilcox danomatika@gmail.com:
On Mar 25, 2014, at 6:00 AM, pd-dev-request@iem.at wrote:
*From: *Kjetil Matheussen k.s.matheussen@gmail.com *Subject: **Re: [PD-dev] Destructor in external classes* *Date: *March 24, 2014 at 12:32:00 PM CDT *To: *Antoine Villeret antoine.villeret@gmail.com *Cc: *IOhannes m zmölnig zmoelnig@iem.at, pd-dev List pd-dev@iem.at *Reply-To: *k.s.matheussen@notam02.no
On Mon, Mar 24, 2014 at 2:56 PM, Antoine Villeret antoine.villeret@gmail.com wrote:
hello,
the free method seems to be called when the object is deleted from the canvas.
is there a similar method called on Pd quit ? I'm asking that because I'm rewriting a pix_openni2 object and to free the openni context i have to call a shutdown() function on quit and not on object deletion
How about 'atexit'?
Why not keep track of the number of open openni objects, then call shutdown when the last one is released?
Dan Wilcox @danomatika danomatika.com robotcowboy.com
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
oops
in fact cleanup with free method doesn't work because it's not called on quit but only on object deletion, so the atexit() seems to be the key
thanks kjetil
+ a
-- do it yourself http://antoine.villeret.free.fr
2014-03-25 16:01 GMT+01:00 Antoine Villeret antoine.villeret@gmail.com:
for now the OpenNI init() function is called from obj_setupCallback which is called only once and if I call shutdown() I need to recall init() on new instance creation
so yes it could be a workaround but having a onQuit() method will make my work easier :-)
a
-- do it yourself http://antoine.villeret.free.fr
2014-03-25 15:50 GMT+01:00 Dan Wilcox danomatika@gmail.com:
On Mar 25, 2014, at 6:00 AM, pd-dev-request@iem.at wrote:
*From: *Kjetil Matheussen k.s.matheussen@gmail.com *Subject: **Re: [PD-dev] Destructor in external classes* *Date: *March 24, 2014 at 12:32:00 PM CDT *To: *Antoine Villeret antoine.villeret@gmail.com *Cc: *IOhannes m zmölnig zmoelnig@iem.at, pd-dev List pd-dev@iem.at *Reply-To: *k.s.matheussen@notam02.no
On Mon, Mar 24, 2014 at 2:56 PM, Antoine Villeret antoine.villeret@gmail.com wrote:
hello,
the free method seems to be called when the object is deleted from the canvas.
is there a similar method called on Pd quit ? I'm asking that because I'm rewriting a pix_openni2 object and to free the openni context i have to call a shutdown() function on quit and not on object deletion
How about 'atexit'?
Why not keep track of the number of open openni objects, then call shutdown when the last one is released?
Dan Wilcox @danomatika danomatika.com robotcowboy.com
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev