/soc/2013/ankitkv/gobjectification: 2ce8046ba0bc: Check if a plu...

Ankit Vani a at nevitus.org
Mon Sep 23 17:45:58 EDT 2013


Changeset: 2ce8046ba0bcff8039448c7614933936d550356b
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-24 03:06 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/2ce8046ba0bc

Description:

Check if a plugin is native before registering new types for it

diffstat:

 libpurple/plugins.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (21 lines):

diff --git a/libpurple/plugins.c b/libpurple/plugins.c
--- a/libpurple/plugins.c
+++ b/libpurple/plugins.c
@@ -245,6 +245,8 @@ purple_plugin_register_type(PurplePlugin
                             GTypeFlags flags)
 {
 #ifdef PURPLE_PLUGINS
+	g_return_val_if_fail(GPLUGIN_IS_NATIVE_PLUGIN(plugin), G_TYPE_INVALID);
+
 	return gplugin_native_plugin_register_type(GPLUGIN_NATIVE_PLUGIN(plugin),
 	                                           parent, name, info, flags);
 
@@ -259,6 +261,8 @@ purple_plugin_add_interface(PurplePlugin
                             const GInterfaceInfo *interface_info)
 {
 #ifdef PURPLE_PLUGINS
+	g_return_if_fail(GPLUGIN_IS_NATIVE_PLUGIN(plugin));
+
 	gplugin_native_plugin_add_interface(GPLUGIN_NATIVE_PLUGIN(plugin),
 	                                    instance_type, interface_type,
 	                                    interface_info);



More information about the Commits mailing list