Opened 9 years ago

Closed 8 years ago

#1009 closed defect (fixed)

Plugin manager does not properly disable plugins

Reported by: zenogantner Owned by: zenogantner
Priority: minor Milestone:
Component: plugins Version: 0.70
Keywords: inconsistency Cc:


How to reproduce:

  1. Ensure that e.g. the XML or the LaTeX plugin are enabled.
  2. Load a XML or .tex file.
  3. Disable the plugin.
  4. Try e.g. Ctrl-Shift-C (toggle comment).

Observed: it still works!

Expected: Should not work, because the plugin has status "disabled"

Change History (3)

comment:1 Changed 9 years ago by bowtie

  • Owner set to zenogantner
  • Status changed from new to assigned

Have you tried


=head2 C<plugin_disable>

The C<plugin_disable> method is called by Padre for various reasons to request
the plug-in do whatever tasks are necessary to shut itself down. This also
provides an opportunity to save configuration information, save caches to
disk, and so on.

Most often, this will be when Padre itself is shutting down. Other uses may
be when the user wishes to disable the plug-in, when the plug-in is being
reloaded, or if the plug-in is about to be upgraded.

If you have any private classes other than the standard C<Padre::Plugin::Foo>, you
should unload them as well as the plug-in may be in the process of upgrading
and will want those classes freed up for use by the new version.

The recommended way of unloading your extra classes is using
L<Class::Unload>. Suppose you have C<My::Extra::Class> and want to unload it,
simply do this in C<plugin_disable>:

  require Class::Unload;

Class::Unload takes care of all the tedious bits for you. Note that you
should B<not> unload any external C<CPAN> dependencies, as these may be needed
by other plug-ins or Padre itself. Only classes that are part of your plug-in
should be unloaded.

Returns true on success, or false if the unloading process failed and your
plug-in has been left in an unknown state.


from Padre::Plugin

comment:2 Changed 9 years ago by zenogantner

Thank you for the hint.

Just Class::Unload does not do the job, I guess I have also have to replace all objects of that class that currently exist by normal Padre::Document objects.

Will work on that ...

comment:3 Changed 8 years ago by bowtie

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.