Mercurial > pidgin
comparison src/plugin.c @ 13135:7fd39c81d5e9
[gaim-migrate @ 15497]
Rest of SF Patch #1417219 from Sadrul
"Also, loading/unloading plugins gives errors in the
debug-window. Register/unregistering the plugins when
they are created and destroyed seem to quiet it down.
Turns out, the same is done for all the other
core-subtypes."
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Mon, 06 Feb 2006 07:53:51 +0000 |
| parents | a0a4b44239e8 |
| children | 58b8e87ad657 |
comparison
equal
deleted
inserted
replaced
| 13134:b2d838b7eb00 | 13135:7fd39c81d5e9 |
|---|---|
| 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 21 */ | 21 */ |
| 22 #include "internal.h" | 22 #include "internal.h" |
| 23 | 23 |
| 24 #include "accountopt.h" | 24 #include "accountopt.h" |
| 25 #include "dbus-maybe.h" | |
| 25 #include "debug.h" | 26 #include "debug.h" |
| 26 #include "notify.h" | 27 #include "notify.h" |
| 27 #include "prefs.h" | 28 #include "prefs.h" |
| 28 #include "prpl.h" | 29 #include "prpl.h" |
| 29 #include "request.h" | 30 #include "request.h" |
| 188 | 189 |
| 189 plugin = g_new0(GaimPlugin, 1); | 190 plugin = g_new0(GaimPlugin, 1); |
| 190 | 191 |
| 191 plugin->native_plugin = native; | 192 plugin->native_plugin = native; |
| 192 plugin->path = (path == NULL ? NULL : g_strdup(path)); | 193 plugin->path = (path == NULL ? NULL : g_strdup(path)); |
| 194 | |
| 195 GAIM_DBUS_REGISTER_POINTER(plugin, GaimPlugin); | |
| 193 | 196 |
| 194 return plugin; | 197 return plugin; |
| 195 } | 198 } |
| 196 | 199 |
| 197 GaimPlugin * | 200 GaimPlugin * |
| 759 * we shouldn't, and crashing while trying to load an old plugin */ | 762 * we shouldn't, and crashing while trying to load an old plugin */ |
| 760 if(plugin->info == NULL || plugin->info->magic != GAIM_PLUGIN_MAGIC || | 763 if(plugin->info == NULL || plugin->info->magic != GAIM_PLUGIN_MAGIC || |
| 761 plugin->info->major_version != GAIM_MAJOR_VERSION) { | 764 plugin->info->major_version != GAIM_MAJOR_VERSION) { |
| 762 if(plugin->handle) | 765 if(plugin->handle) |
| 763 g_module_close(plugin->handle); | 766 g_module_close(plugin->handle); |
| 767 | |
| 768 GAIM_DBUS_UNREGISTER_POINTER(plugin); | |
| 769 | |
| 764 g_free(plugin); | 770 g_free(plugin); |
| 765 return; | 771 return; |
| 766 } | 772 } |
| 767 | 773 |
| 768 if (plugin->info != NULL && plugin->info->dependencies != NULL) | 774 if (plugin->info != NULL && plugin->info->dependencies != NULL) |
| 826 } | 832 } |
| 827 } | 833 } |
| 828 | 834 |
| 829 if (plugin->path != NULL) g_free(plugin->path); | 835 if (plugin->path != NULL) g_free(plugin->path); |
| 830 if (plugin->error != NULL) g_free(plugin->error); | 836 if (plugin->error != NULL) g_free(plugin->error); |
| 837 | |
| 838 GAIM_DBUS_UNREGISTER_POINTER(plugin); | |
| 831 | 839 |
| 832 g_free(plugin); | 840 g_free(plugin); |
| 833 #endif /* !GAIM_PLUGINS */ | 841 #endif /* !GAIM_PLUGINS */ |
| 834 } | 842 } |
| 835 | 843 |
