On Thu, Mar 28, 2013 at 12:42 PM, SourceForge.net <span dir="ltr">&lt;<a href="mailto:noreply@sourceforge.net" target="_blank">noreply@sourceforge.net</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Patches item #3609350, was opened at 2013-03-28 04:42<br>
Message generated for change (Tracker Item Submitted) made by zmoelnig<br>
You can respond by visiting:<br>
<a href="https://sourceforge.net/tracker/?func=detail&amp;atid=478072&amp;aid=3609350&amp;group_id=55736" target="_blank">https://sourceforge.net/tracker/?func=detail&amp;atid=478072&amp;aid=3609350&amp;group_id=55736</a><br>


<br>
Please note that this message will contain a full copy of the comment thread,<br>
including the initial issue submission, for this request,<br>
not just the latest update.<br>
Category: puredata<br>
Group: bugfix<br>
Status: Open<br>
Resolution: None<br>
Priority: 5<br>
Private: No<br>
Submitted By: IOhannes m zmölnig (zmoelnig)<br>
Assigned to: Miller Puckette (millerpuckette)<br>
Summary: prevent recursive loading of gui-plugins<br>
<br>
Initial Comment:<br>
if a gui-plugin loads other plugin, we might easily encounter a recursion (where the plugin tries to load itself).<br>
while the current gui-plugin loader mechanism tries to prevent re-loading of the &quot;same&quot; plugin (based on the filename of the plugin), it doesn&#39;t catch recursive loading.<br>
the attached patch fixes this, by adding the to-be-loaded plugin to the &quot;::loaded_plugins&quot; list, then tries to load it and removes it from the list if the loading fails<br>
(rather than adding the plugin to the list after the loading succeeded)<br>
<br></blockquote></div><br clear="all"><br>Some minor comments from the perspective of the current plugins-plugin which you may or may not want to consider:<br>- the plugin creates a ::plugins_loaded list which is almost the same as ::loaded_plugins with the difference that &quot;-plugin.tcl&quot; is stripped and, more importantly, brackets in the name are stripped too because they can cause weird things when handling the strings in tcl.<br>

- for the sake of tidiness, the plugin introduces a ::plugins namespace where all the functions go.<br>- what about splitting the whole plugin stuff out into a new pd_plugins.tcl so that we don&#39;t have to worry too much about bloating pd-gui.tcl?<br>

FYI: current plugins-plugin is cca. 200 lines, of which obligatory protocol is 20 lines, switching mechanism is 40 lines, meta extraction is 60 lines and building the dialog box is 70 lines - thought this may assist the decision about what to maintain inside pd and what to leave in a plugin.<br>

<br>My 2 cents are that the moving-the-file way of managing is ugly and a list of enabled plugins shall be maintained in the preferences. Pd-gui could load everything (or nothing) by default, letting a plugin modify the list. So it would at the end take only a few extra lines in core pd gui.<br>

<br>András