avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcrea...@apache.org
Subject svn commit: r1384534 - in /avro/trunk: CHANGES.txt lang/c/src/avro/schema.h lang/c/src/schema.c
Date Thu, 13 Sep 2012 21:14:47 GMT
Author: dcreager
Date: Thu Sep 13 21:14:47 2012
New Revision: 1384534

URL: http://svn.apache.org/viewvc?rev=1384534&view=rev
Log:
AVRO-1129. C: Detect when avro_schema_decref frees schema

Modified:
    avro/trunk/CHANGES.txt
    avro/trunk/lang/c/src/avro/schema.h
    avro/trunk/lang/c/src/schema.c

Modified: avro/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/avro/trunk/CHANGES.txt?rev=1384534&r1=1384533&r2=1384534&view=diff
==============================================================================
--- avro/trunk/CHANGES.txt (original)
+++ avro/trunk/CHANGES.txt Thu Sep 13 21:14:47 2012
@@ -25,6 +25,9 @@ Avro 1.7.2 (unreleased)
     AVRO-1138. C: Add function for opening existing data file with non-default
     block size.  (Maxim Pugachev via dcreager)
 
+    AVRO-1129. C: Detect when avro_schema_decref frees schema.
+    (Maxim Pugachev via dcreager)
+
   BUG FIXES
 
     AVRO-1128. Java: Fix SpecificRecordBase#equals() to work for

Modified: avro/trunk/lang/c/src/avro/schema.h
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/avro/schema.h?rev=1384534&r1=1384533&r2=1384534&view=diff
==============================================================================
--- avro/trunk/lang/c/src/avro/schema.h (original)
+++ avro/trunk/lang/c/src/avro/schema.h Thu Sep 13 21:14:47 2012
@@ -108,7 +108,7 @@ avro_schema_t avro_schema_copy(avro_sche
 int avro_schema_equal(avro_schema_t a, avro_schema_t b);
 
 avro_schema_t avro_schema_incref(avro_schema_t schema);
-void avro_schema_decref(avro_schema_t schema);
+int avro_schema_decref(avro_schema_t schema);
 
 int avro_schema_match(avro_schema_t writers_schema,
 		      avro_schema_t readers_schema);

Modified: avro/trunk/lang/c/src/schema.c
URL: http://svn.apache.org/viewvc/avro/trunk/lang/c/src/schema.c?rev=1384534&r1=1384533&r2=1384534&view=diff
==============================================================================
--- avro/trunk/lang/c/src/schema.c (original)
+++ avro/trunk/lang/c/src/schema.c Thu Sep 13 21:14:47 2012
@@ -188,11 +188,14 @@ avro_schema_t avro_schema_incref(avro_sc
 	return schema;
 }
 
-void avro_schema_decref(avro_schema_t schema)
+int
+avro_schema_decref(avro_schema_t schema)
 {
 	if (schema && avro_refcount_dec(&schema->refcount)) {
 		avro_schema_free(schema);
+		return 0;
 	}
+	return 1;
 }
 
 avro_schema_t avro_schema_string(void)



Mime
View raw message