[PD-dev] [ pure-data-Patches-1502860 ] class-destructor (free-method) not called when quitting pd

SourceForge.net noreply at sourceforge.net
Fri Feb 17 21:20:03 CET 2012


Patches item #1502860, was opened at 2006-06-08 05:33
Message generated for change (Comment added) made by eighthave
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1502860&group_id=55736

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: puredata-dev
Group: bugfix
Status: Open
Resolution: None
Priority: 7
Private: No
Submitted By: IOhannes m zmölnig (zmoelnig)
Assigned to: Miller Puckette (millerpuckette)
Summary: class-destructor (free-method) not called when quitting pd

Initial Comment:
when an object is destroyed (either directly deleted or
by closing the patch containing it) the "free" method
(a "destructor" in c++-speak) for this object is called.

however, when pd is "quit" (e.g. "Ctrl-Q"), this
destructor does not get called, which potentially
leaves the system in a bad state.


the attached patch fixes this by adding a
"glob_closeall()" function to g_editor.c (which closes
all root canvases) and calling it from within
glob_quit() in s_inter.c

----------------------------------------------------------------------

>Comment By: Hans-Christoph Steiner (eighthave)
Date: 2012-02-17 12:20

Message:
Ok, I just included this patch in pd-extended.git, tomorrow's builds should
have it.

----------------------------------------------------------------------

Comment By: IOhannes m zmölnig (zmoelnig)
Date: 2012-02-16 10:57

Message:
i can't think of any.

iirc, miller mentioned something along the lines, that calling all those
destructors during an emergency shutdown might just take too long during a
performance. (otoh, if a network port is blocked due to not properly
cleaning up, this might take even longer)

hopefully, if the inclusion in Pd-extended can show that there is no
problem (which i believe), we could get it into Pd-proper.

----------------------------------------------------------------------

Comment By: Hans-Christoph Steiner (eighthave)
Date: 2012-02-16 10:45

Message:
What are the risks or downsides to this patch?  I am thinking it should be
in Pd-extended

----------------------------------------------------------------------

Comment By: IOhannes m zmölnig (zmoelnig)
Date: 2011-04-18 09:18

Message:
updated the patch so it applies to Pd-0.43 (and incorporated thomas'
suggestion)

----------------------------------------------------------------------

Comment By: Thomas Grill (xovo)
Date: 2006-08-02 09:20

Message:
Logged In: YES 
user_id=350252

I think there's a problem in this patch when traversing the canvas list
with 
canvases vanishing meanwhile. It should be more like:

void glob_closeall(void*dummy, t_floatarg fforce)
{
    t_canvas*x,*y;
    for (x = canvas_list; x; )
    {
		y = x->gl_next;
        canvas_menuclose(x, fforce); /* forced closing of this root canvas
*/
		x = y;
    }
}

Still, this assumes that PD doesn't do more than removing that one entry
from 
the canvas list, which is not very clean.

----------------------------------------------------------------------

Comment By: IOhannes m zmölnig (zmoelnig)
Date: 2006-07-26 02:43

Message:
Logged In: YES 
user_id=564396

actually i think this is rather important when objects
interface with the system - so i raised the priority

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1502860&group_id=55736



More information about the Pd-dev mailing list