Ticket #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: |
Description
How to reproduce:
- Ensure that e.g. the XML or the LaTeX plugin are enabled.
- Load a XML or .tex file.
- Disable the plugin.
- Try e.g. Ctrl-Shift-C (toggle comment).
Observed: it still works!
Expected: Should not work, because the plugin has status "disabled"
Change History
comment:1 Changed 23 months ago by bowtie
- Owner set to zenogantner
- Status changed from new to assigned
Note: See
TracTickets for help on using
tickets.

Have you tried
=pod =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->unload('My::Extra::Class'); 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. =cutfrom Padre::Plugin