plugins/mono/loader/blist-glue.c

changeset 11996
858bd928831c
parent 11980
fe5c2c58508c
child 12442
de1895ff7709
--- a/plugins/mono/loader/blist-glue.c	Sun Nov 06 23:02:39 2005 +0000
+++ b/plugins/mono/loader/blist-glue.c	Sun Nov 06 23:09:07 2005 +0000
@@ -12,22 +12,12 @@
 MonoObject* gaim_blist_build_buddy_object(void* data)
 {
 	MonoObject *obj = NULL;
-	MonoClass *klass = NULL;
 			
 	GaimBuddy *buddy = (GaimBuddy*)data;
 	
-	klass = mono_class_from_name(ml_get_api_image(), "Gaim", "Buddy");
-	if (!klass) {
-		gaim_debug(GAIM_DEBUG_FATAL, "mono", "couldn't build the class!\n");
-	}
-	
-	obj = mono_object_new(ml_get_domain(), klass);
-	if (!obj) {
-		gaim_debug(GAIM_DEBUG_FATAL, "mono", "couldn't create the object!\n");
-	}
-	
-	mono_runtime_object_init(obj);
-	
+	obj = ml_create_api_object("Buddy");
+	g_return_val_if_fail(obj != NULL, NULL);
+		
 	ml_set_prop_string(obj, "Name", (char*)gaim_buddy_get_name(buddy));
 	ml_set_prop_string(obj, "Alias", (char*)gaim_buddy_get_alias(buddy));
 	

mercurial