On Apr 21, 1:32 pm, "Edward K. Ream" <[EMAIL PROTECTED]> wrote:


> > The onCreate  method gets called every time *any* new commander is
> > created therefore the plugin controllers get recreated for *every*
> > commander *every* time a new commander is created.
>
> I'm not sure whether this is a serious problem.  Your solution works, as
> does keeping a module-level dictionary of controllers.  There are several
> examples of this pattern, iirc.
>
> Perhaps some more documentation is needed, but I'd rather not change how
> events get generated unless absolutely required.

Using a module-level dictionary doesn't help the problem, all the
controllers still gets recreated every time a new window is opened and
assigned to the dictionary. There are a couple of plugins which use
this method where exactly this happens.

The problem is that any old controller that has events bound to them
do not die (at least the event handlers don't).

I am not proposing any changes in the event handler, just that the
Template be changed so that future users are aware of the problem and
the solution. The solution being to make sure that they only respond
to the onCreate event once.

The proper and simple solution, of course, is to unregisterHandler in
onCreate, I should have thought of that sooner.

I'll modify the Template to that effect.

Bob

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to