(cos_make_symbol): Use `cos_retain_object' for `obj->name'.
authorMORIOKA Tomohiko <tomo.git@chise.org>
Tue, 16 Apr 2013 09:47:04 +0000 (18:47 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Tue, 16 Apr 2013 09:47:04 +0000 (18:47 +0900)
(cos_retain_symbol): New function.

symbol.c

index a01b4ce..94cf020 100644 (file)
--- a/symbol.c
+++ b/symbol.c
@@ -66,10 +66,19 @@ cos_make_symbol (COS_String string)
 
   obj->name = string;
   obj->value = NULL;
+  cos_retain_object (string);
   return obj;
 }
 
 int
+cos_retain_symbol (COS_Object obj)
+{
+  cos_retain_object (((COS_Symbol)obj)->value);
+  cos_retain_object (((COS_Symbol)obj)->name);
+  return 0;
+}
+
+int
 cos_release_symbol (COS_Object obj)
 {
   if (obj == NULL)