]> jfr.im git - irc/xchat.git/commitdiff
Fix reinit attempt handling code. When xchat_plugin_init returns 0
authorlsitu <redacted>
Wed, 22 Dec 2010 03:53:05 +0000 (03:53 +0000)
committerlsitu <redacted>
Wed, 22 Dec 2010 03:53:05 +0000 (03:53 +0000)
xchat_plugin_deinit does not get called, this was leaving reinit_tried
with an incorrect value which prevented the plugin from unloading and
reloading correctly.

git-svn-id: svn://svn.code.sf.net/p/xchat/svn@1475 893a96be-7f27-4fdf-9d1e-6aeec9d3cce1

ChangeLog
plugins/perl/perl.c

index 963e777f6bf470ddb26a4a62ab822b9ec0aafce7..750d3f752b767187bdb366da14413fa29c9ede98 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,19 @@ This log DOES NOT apply to XChat for Windows.
 There are always more changes than listed here, these are just the
 highlights. The full CVS log is available at www.xchat.org/cvslog/
 
+------------------------------------------------------------------------------
+ 2.8.10 - dd/mm/yyyy
+------------------------------------------------------------------------------
+ - Perl (Lian Wan Situ)
+  * Added two new options to hook_print, run_after_event and filter. See
+    documentation for details.
+  * When building on Windows, generate the name of the DLL for the Perl
+    library based on information from the header files instead of hardcoding
+        the value.
+  * Fixed a bug in the reinit handling code. The bug prevented the plugin from
+    cleaning up properly. Which includes unloading scripts and removing
+        their GUI entries.
+
 ------------------------------------------------------------------------------
  2.8.8 - 30/May/2010
 ------------------------------------------------------------------------------
index 60dd770a89076a1ad7057c0537044655f073c488..439f7c70cdde177a899e72141cb7a1d93ea4c9fd 100644 (file)
@@ -1470,19 +1470,17 @@ xchat_plugin_get_info (char **name, char **desc, char **version,
 /* Reinit safeguard */
 
 static int initialized = 0;
-static int reinit_tried = 0;
 
 int
 xchat_plugin_init (xchat_plugin * plugin_handle, char **plugin_name,
                                                 char **plugin_desc, char **plugin_version, char *arg)
 {
-       ph = plugin_handle;
-
        if (initialized != 0) {
-               xchat_print (ph, "Perl interface already loaded\n");
-               reinit_tried++;
+               xchat_print (plugin_handle, "Perl interface already loaded\n");
                return 0;
        }
+
+       ph = plugin_handle;
        initialized = 1;
 
        *plugin_name = "Perl";
@@ -1512,13 +1510,9 @@ xchat_plugin_init (xchat_plugin * plugin_handle, char **plugin_name,
 int
 xchat_plugin_deinit (xchat_plugin * plugin_handle)
 {
-       if (reinit_tried) {
-               reinit_tried--;
-               return 1;
-       }
-
        perl_end ();
 
+       initialized = 0;
        xchat_print (plugin_handle, "Perl interface unloaded\n");
 
        return 1;