changeset 12984:d1e6890ed062

[gaim-migrate @ 15337] Perl plugins now have ids. Not having them was causing crashes with the dependent plugin unloading stuff. Some fixes to that code in a minute. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Sun, 22 Jan 2006 05:17:38 +0000
parents 92ae94619e2c
children de3a3669dbe1
files plugins/perl/perl.c
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/perl/perl.c	Sun Jan 22 05:11:13 2006 +0000
+++ b/plugins/perl/perl.c	Sun Jan 22 05:17:38 2006 +0000
@@ -299,6 +299,8 @@
 			/* We know this one exists. */
 			key = hv_fetch(plugin_info, "name", strlen("name"), 0);
 			info->name = g_strdup(SvPV(*key, len));
+			/* Set id here in case we don't find one later. */
+			info->id = g_strdup(SvPV(*key, len));
 
 			if ((key = hv_fetch(plugin_info, "GTK_UI",
 			                    strlen("GTK_UI"), 0)))
@@ -324,11 +326,10 @@
 			                    strlen("version"), 0)))
 				info->version = g_strdup(SvPV(*key, len));
 
-			if ((key = hv_fetch(plugin_info, "load",
-			                    strlen("load"), 0)))
-				gps->load_sub = g_strdup_printf("%s::%s",
-				                                gps->package,
-				                                SvPV(*key, len));
+			/* We know this one exists. */
+			key = hv_fetch(plugin_info, "load", strlen("load"), 0);
+			gps->load_sub = g_strdup_printf("%s::%s", gps->package,
+			                                SvPV(*key, len));
 
 			if ((key = hv_fetch(plugin_info, "unload",
 			                    strlen("unload"), 0)))
@@ -336,6 +337,13 @@
 				                                  gps->package,
 				                                  SvPV(*key, len));
 
+			if ((key = hv_fetch(plugin_info, "id",
+			                    strlen("id"), 0))) {
+				g_free(info->id);
+				info->id = g_strdup_printf("perl-%s",
+				                           SvPV(*key, len));
+			}
+
 		/********************************************************/
 		/* Only one of the next two options should be present   */
 		/*                                                      */